summaryrefslogtreecommitdiff
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
parent37981beb729b19337051eb79306b811b1a719641 (diff)
downloadATCD-6611479da53626a8b0fa590dea7d71cc39cbbdfa.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog-98b6
-rw-r--r--ace/Synch_T.cpp9
-rw-r--r--ace/Synch_T.h3
3 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b
index 55069339805..77c8c78ada7 100644
--- a/ChangeLog-98b
+++ b/ChangeLog-98b
@@ -1,3 +1,9 @@
+Mon Sep 14 09:37:09 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Synch_T.h: Fixed a deadlock condition caused by acquiring
+ the internal lock in multiple places during the same call.
+ Thanks to Jorn Jensen <jornj@funcom.com> for reporting this.
+
Mon Sep 14 01:59:51 1998 Nanbor Wang <nanbor@cs.wustl.edu>
* ace/Strategies_T.{h,i,cpp}: Added two new classes
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)
diff --git a/ace/Synch_T.h b/ace/Synch_T.h
index ad181e51cd9..d5f89274834 100644
--- a/ace/Synch_T.h
+++ b/ace/Synch_T.h
@@ -294,7 +294,8 @@ protected:
// thread-specific storage.
int ts_init (void) const;
- // Factors out common code for initializing TSS.
+ // Factors out common code for initializing TSS. This must NOT be
+ // called with the lock held...
#if !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)))
TYPE *type_;