fix(util/stackinfo): on OSX Boost does not seem to be based on pthread library
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
7124866a4f
commit
fb5c7c8e92
1 changed files with 16 additions and 9 deletions
|
@ -43,6 +43,11 @@ size_t get_stack_size(int main) {
|
|||
return curr.rlim_max;
|
||||
} else {
|
||||
#if defined(LEAN_MULTI_THREAD)
|
||||
{
|
||||
#if defined(LEAN_USE_BOOST)
|
||||
// Boost does seems to be based on pthread on OSX
|
||||
return get_thread_attributes().get_stack_size();
|
||||
#else
|
||||
// This branch retrieves the default thread size for pthread threads.
|
||||
// This is *not* the stack size of the main thread.
|
||||
pthread_attr_t attr;
|
||||
|
@ -53,6 +58,8 @@ size_t get_stack_size(int main) {
|
|||
throw_get_stack_size_failed();
|
||||
}
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue