Ticket #8371: thread_config.patch

File thread_config.patch, 817 bytes (added by Andrey Semashev, 10 years ago)

The patch disables C++11 call_once when constexpr is not supported.

  • boost/thread/detail/config.hpp

     
    161161#define BOOST_THREAD_PROVIDES_ONCE_CXX11
    162162#endif
    163163
     164// For C++11 call_once interface the compiler MUST support constexpr.
     165// Otherwise once_flag would be initialized during dynamic initialization stage, which is not thread-safe.
     166#if defined(BOOST_THREAD_PROVIDES_ONCE_CXX11) && defined(BOOST_NO_CXX11_CONSTEXPR)
     167#undef BOOST_THREAD_PROVIDES_ONCE_CXX11
     168#endif
     169
    164170// THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
    165171#if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE \
    166172 && ! defined BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE