diff options
Diffstat (limited to 'ace/TSS_T.cpp')
-rw-r--r-- | ace/TSS_T.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ace/TSS_T.cpp b/ace/TSS_T.cpp index fc25332dd1f..ac474228bda 100644 --- a/ace/TSS_T.cpp +++ b/ace/TSS_T.cpp @@ -29,15 +29,10 @@ ACE_ALLOC_HOOK_DEFINE(ACE_TSS) template <class TYPE> ACE_TSS<TYPE>::~ACE_TSS (void) { -#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) - if (this->once_ != 0) - { - ACE_OS::thr_key_detach (this->key_, this); - } -#else // defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) - // We own it, we need to delete it. - delete type_; -#endif // defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) + // We can't call <ACE_OS::thr_keyfree> until *all* of the threads + // that are using that key have done an <ACE_OS::thr_key_detach>. + // Otherwise, we'll end up with "dangling TSS pointers." + ACE_OS::thr_key_detach (this); } template <class TYPE> TYPE * |