--- boost_1_51_0/libs/thread/src/pthread/once.cpp.orig 2012-05-22 19:03:15.000000000 +0200 +++ boost_1_51_0/libs/thread/src/pthread/once.cpp 2012-08-31 11:32:13.367850688 +0200 @@ -8,6 +8,9 @@ #include #include #include +#if defined BOOST_THREAD_PATCH +#include // memcmp. +#endif #include namespace boost --- boost_1_58_0/libs/thread/src/pthread/thread.cpp.orig 2015-03-21 15:44:02.000000000 +0100 +++ boost_1_58_0/libs/thread/src/pthread/thread.cpp 2015-05-14 18:28:41.638216099 +0200 @@ -124,7 +124,8 @@ } ~delete_current_thread_tls_key_on_dlclose_t() { - if (current_thread_tls_init_flag.epoch!=BOOST_ONCE_INITIAL_FLAG_VALUE) + const boost::once_flag uninitialized=BOOST_ONCE_INIT; + if (memcmp(¤t_thread_tls_init_flag,&uninitialized,sizeof(boost::once_flag))) { pthread_key_delete(current_thread_tls_key); }