Comment 1 for bug 1844022

Revision history for this message
Florian Weimer (fweimer) wrote :

I assume the code in another_thread attempts to obtain the size of the current thread. But the code just reads back the default stack size, which may have changed due to the set_default_thread_stack_size call.

One way to obtain the size of the current thread stack is this call:

      if(int err = ::pthread_getattr_np(pthread_self(), &attr))
                throw std::system_error(err, std::system_category(), "pthread_getattr_np");

This should give consistent results all the time.