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:
Leonardo de Moura 2014-06-07 20:47:46 -07:00
parent 7124866a4f
commit fb5c7c8e92

View file

@ -43,6 +43,11 @@ size_t get_stack_size(int main) {
return curr.rlim_max; return curr.rlim_max;
} else { } else {
#if defined(LEAN_MULTI_THREAD) #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 branch retrieves the default thread size for pthread threads.
// This is *not* the stack size of the main thread. // This is *not* the stack size of the main thread.
pthread_attr_t attr; pthread_attr_t attr;
@ -53,6 +58,8 @@ size_t get_stack_size(int main) {
throw_get_stack_size_failed(); throw_get_stack_size_failed();
} }
return result; return result;
#endif
}
#else #else
return 0; return 0;
#endif #endif