| 1 | |
| 2 | |
| 3 | |
| 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 |