Index: boost/thread/detail/config.hpp =================================================================== --- boost/thread/detail/config.hpp (revision 83090) +++ boost/thread/detail/config.hpp (working copy) @@ -161,6 +161,12 @@ #define BOOST_THREAD_PROVIDES_ONCE_CXX11 #endif +// For C++11 call_once interface the compiler MUST support constexpr. +// Otherwise once_flag would be initialized during dynamic initialization stage, which is not thread-safe. +#if defined(BOOST_THREAD_PROVIDES_ONCE_CXX11) && defined(BOOST_NO_CXX11_CONSTEXPR) +#undef BOOST_THREAD_PROVIDES_ONCE_CXX11 +#endif + // THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE \ && ! defined BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE