1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 12:15:32 +03:00
aports/community/mpd/stacksize.patch
2018-02-07 11:07:10 +00:00

17 lines
526 B
Diff

--- ./src/thread/Thread.cxx.orig
+++ ./src/thread/Thread.cxx
@@ -35,8 +35,12 @@
if (handle == nullptr)
throw MakeLastError("Failed to create thread");
#else
- 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)
throw MakeErrno(e, "Failed to create thread");
#endif