--- boost_1_43_0/libs/thread/src/pthread/once.cpp.orig 2010-06-10 16:23:33.000000000 +0200 +++ boost_1_43_0/libs/thread/src/pthread/once.cpp 2010-06-11 13:30:57.711966591 +0200 @@ -32,6 +32,11 @@ BOOST_VERIFY(!pthread_key_create(&epoch_tss_key,delete_epoch_tss_data)); } + void __attribute__((destructor)) delete_epoch_tss_key_on_dlclose() + { + if (epoch_tss_key_flag!=PTHREAD_ONCE_INIT) + pthread_key_delete(epoch_tss_key); + } } boost::uintmax_t& get_once_per_thread_epoch() --- boost_1_43_0/libs/thread/src/pthread/thread.cpp.orig 2010-04-01 17:04:15.000000000 +0200 +++ boost_1_43_0/libs/thread/src/pthread/thread.cpp 2010-06-11 14:16:05.857967651 +0200 @@ -92,6 +92,12 @@ { BOOST_VERIFY(!pthread_key_create(¤t_thread_tls_key,&tls_destructor)); } + + void __attribute__((destructor)) delete_current_thread_tls_key_on_dlclose() + { + if (current_thread_tls_init_flag.epoch!=BOOST_ONCE_INITIAL_FLAG_VALUE) + pthread_key_delete(current_thread_tls_key); + } } boost::detail::thread_data_base* get_current_thread_data()