diff options
author | Eric Wild <ewild@sysmocom.de> | 2019-06-17 13:02:44 +0200 |
---|---|---|
committer | Eric Wild <ewild@sysmocom.de> | 2019-06-17 14:41:34 +0200 |
commit | ac0487eb66c07934cb13791ad625e86d580e8ab0 (patch) | |
tree | c46bdbad011d71b3b7bf31e05290d9d81c995011 /CommonLibs/Threads.cpp | |
parent | 6a305feb0f7bdcae9d0552e5d2bca9c48ec2e63f (diff) |
Add option to set stack size in config file, default == 0 == OS default
Change-Id: Id752f6b5ce9a96a67cd1ff835687ce0e03d3a50d
Diffstat (limited to 'CommonLibs/Threads.cpp')
-rw-r--r-- | CommonLibs/Threads.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CommonLibs/Threads.cpp b/CommonLibs/Threads.cpp index c056d69..ccea1e7 100644 --- a/CommonLibs/Threads.cpp +++ b/CommonLibs/Threads.cpp @@ -135,8 +135,10 @@ void Thread::start(void *(*task)(void*), void *arg) // (pat) Moved initialization to constructor to avoid crash in destructor. //res = pthread_attr_init(&mAttrib); //assert(!res); - res = pthread_attr_setstacksize(&mAttrib, mStackSize); - assert(!res); + if (mStackSize != 0) { + res = pthread_attr_setstacksize(&mAttrib, mStackSize); + assert(!res); + } res = pthread_create(&mThread, &mAttrib, task, arg); assert(!res); } |