diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-21 06:11:17 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-21 06:11:17 +0000 |
commit | e3ab71fad48ca63df1b40fabc65eca2320928d30 (patch) | |
tree | 712662989d3c40ada5c8e76fd8d99f4440e3f9bb /ace/Synch_T.cpp | |
parent | 9263d31bb440bb66f66a02565bbb94cda160a1f0 (diff) | |
download | ATCD-e3ab71fad48ca63df1b40fabc65eca2320928d30.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/Synch_T.cpp')
-rw-r--r-- | ace/Synch_T.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp index 6eef0942755..fd89d2e26d5 100644 --- a/ace/Synch_T.cpp +++ b/ace/Synch_T.cpp @@ -309,31 +309,22 @@ ACE_TSS<TYPE>::ts_get (void) const // Create and initialize thread-specific ts_obj. if (this->once_ == 0) { - // We need the lock for ACE_TSS_Cleanup as well since the - // ACE_Thread::keycreate() method requires access to internal - // tables. This is to avoid deadlocks when using ACE_TSS from - // the close() hook of an ACE_Task. - ACE_OS::thr_win32_tls_table_lock (); - // Insure that we are serialized! ACE_GUARD_RETURN (ACE_Mutex, ace_mon_2, (ACE_Mutex &) this->keylock_, 0); - int result; - // Use the Double-Check pattern to make sure we only create the // key once! if (this->once_ == 0) - result = ACE_Thread::keycreate ((ACE_thread_key_t *) &this->key_, + { + if (ACE_Thread::keycreate ((ACE_thread_key_t *) &this->key_, &ACE_TSS<TYPE>::cleanup, - (void *) this); - ACE_OS::thr_win32_tls_table_release (); - - if (result != 0) - return 0; // Major problems, this should *never* happen! - else - // This *must* come last to avoid race conditions! Note - // that we need to "cast away const..." - *(int *) &this->once_ = 1; + (void *) this) != 0) + return 0; // Major problems, this should *never* happen! + else + // This *must* come last to avoid race conditions! Note + // that we need to "cast away const..." + *(int *) &this->once_ = 1; + } } TYPE *ts_obj = 0; |