aboutsummaryrefslogtreecommitdiffstats
path: root/main/mpd/stacksize.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-07-15 21:50:50 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-07-20 17:04:31 +0200
commit0550540e2f211c794031142c81c3e752864b8605 (patch)
treef9f6adf30aaac1d8bb6cd7305cfab8bdbaf5b266 /main/mpd/stacksize.patch
parentdda3dc2581bd204c6708dc4edde32f2f8c4f32c8 (diff)
downloadaports-0550540e2f211c794031142c81c3e752864b8605.tar.bz2
aports-0550540e2f211c794031142c81c3e752864b8605.tar.xz
main/mpd: set stacksize
fixes #4448
Diffstat (limited to 'main/mpd/stacksize.patch')
-rw-r--r--main/mpd/stacksize.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/mpd/stacksize.patch b/main/mpd/stacksize.patch
new file mode 100644
index 0000000000..26d6f78079
--- /dev/null
+++ b/main/mpd/stacksize.patch
@@ -0,0 +1,19 @@
+diff --git a/src/thread/Thread.cxx b/src/thread/Thread.cxx
+index 2932d47..fd1f3ce 100644
+--- a/src/thread/Thread.cxx
++++ b/src/thread/Thread.cxx
+@@ -43,8 +43,12 @@ Thread::Start(void (*_f)(void *ctx), void *_ctx, Error &error)
+ #ifndef NDEBUG
+ creating = true;
+ #endif
+-
+- int e = pthread_create(&handle, nullptr, ThreadProc, this);
++ pthread_attr_t attr, *attrptr = nullptr;
++ if ((pthread_attr_init(&attr) == 0)
++ && (pthread_attr_setstacksize(&attr, 1024*1024) == 0)) {
++ attrptr = &attr;
++ }
++ int e = pthread_create(&handle, attrptr, ThreadProc, this);
+
+ if (e != 0) {
+ #ifndef NDEBUG