summaryrefslogtreecommitdiff
path: root/ace/Synch_T.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-09-14 14:40:32 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-09-14 14:40:32 +0000
commit6611479da53626a8b0fa590dea7d71cc39cbbdfa (patch)
tree460b15597c6577b691844a85855d1dcd0cc7596e /ace/Synch_T.cpp
parent37981beb729b19337051eb79306b811b1a719641 (diff)
downloadATCD-6611479da53626a8b0fa590dea7d71cc39cbbdfa.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Synch_T.cpp')
-rw-r--r--ace/Synch_T.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp
index a3a037cdc3e..92aa1c41884 100644
--- a/ace/Synch_T.cpp
+++ b/ace/Synch_T.cpp
@@ -455,13 +455,16 @@ ACE_TSS<TYPE>::ts_object (void) const
template <class TYPE> TYPE *
ACE_TSS<TYPE>::ts_object (TYPE *new_ts_obj)
{
- // Ensure that we are serialized!
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->keylock_, 0);
-
+ // Note, we shouldn't hold the keylock at this point because
+ // <ts_init> does it for us and we'll end up with deadlock
+ // otherwise...
if (this->once_ == 0)
// Create and initialize thread-specific ts_obj.
this->ts_init ();
+ // Ensure that we are serialized!
+ ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->keylock_, 0);
+
TYPE *ts_obj = 0;
#if defined (ACE_HAS_THR_C_DEST)