projects/aports·blob master · refs

17 lines · 526 B

1--- ./src/thread/Thread.cxx.orig
2+++ ./src/thread/Thread.cxx
3@@ -35,8 +35,12 @@
4 if (handle == nullptr)
5 throw MakeLastError("Failed to create thread");
6 #else
7- int e = pthread_create(&handle, nullptr, ThreadProc, this);
8-
9+ pthread_attr_t attr, *attrptr = nullptr;
10+ if ((pthread_attr_init(&attr) == 0)
11+ && (pthread_attr_setstacksize(&attr, 1024*1024) == 0)) {
12+ attrptr = &attr;
13+ }
14+ int e = pthread_create(&handle, attrptr, ThreadProc, this);
15 if (e != 0)
16 throw MakeErrno(e, "Failed to create thread");
17 #endif