2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-24 18:32:32 +00:00

Fixed bug with cleanup_slots definition order on POSIX implementations.

[SVN r16807]
This commit is contained in:
William E. Kempf
2003-01-08 22:22:54 +00:00
parent 48ad27558a
commit 88bb39e3ce

View File

@@ -40,6 +40,17 @@ struct tss_data_t
tss_data_t* tss_data = 0;
boost::once_flag tss_data_once = BOOST_ONCE_INIT;
extern "C" void cleanup_slots(void* p)
{
tss_slots* slots = static_cast<tss_slots*>(p);
for (tss_slots::size_type i = 0; i < slots->size(); ++i)
{
boost::mutex::scoped_lock lock(tss_data->mutex);
(*tss_data->cleanup_handlers[i])((*slots)[i]);
(*slots)[i] = 0;
}
}
void init_tss_data()
{
std::auto_ptr<tss_data_t> temp(new tss_data_t);
@@ -63,17 +74,6 @@ void init_tss_data()
tss_data = temp.release();
}
extern "C" void cleanup_slots(void* p)
{
tss_slots* slots = static_cast<tss_slots*>(p);
for (tss_slots::size_type i = 0; i < slots->size(); ++i)
{
boost::mutex::scoped_lock lock(tss_data->mutex);
(*tss_data->cleanup_handlers[i])((*slots)[i]);
(*slots)[i] = 0;
}
}
#if defined(BOOST_HAS_WINTHREADS)
void __cdecl tss_thread_exit()
{