summaryrefslogtreecommitdiff
path: root/ace/Synch_T.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-01-08 03:54:17 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-01-08 03:54:17 +0000
commit3966b329913d62ed8ef2cc058a98c4cdc3bde7b0 (patch)
tree8519dff27870a264c4a05ce625efd915e1d2ec0b /ace/Synch_T.cpp
parentc74f8ce745a8d81101b4da0be11f448704d53c46 (diff)
downloadATCD-3966b329913d62ed8ef2cc058a98c4cdc3bde7b0.tar.gz
foo
Diffstat (limited to 'ace/Synch_T.cpp')
-rw-r--r--ace/Synch_T.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp
index 9cab6f23136..83fa37e38e8 100644
--- a/ace/Synch_T.cpp
+++ b/ace/Synch_T.cpp
@@ -42,6 +42,9 @@ ACE_Test_and_Set<LOCK, TYPE>::set (TYPE status)
template <class LOCK, class TYPE> int
ACE_Test_and_Set<LOCK, TYPE>::handle_signal (int, siginfo_t *, ucontext_t *)
{
+ // By setting this to 1, we are "signaling" to anyone calling
+ // <is_set> or or <set> that the "test and set" object is in the
+ // "signaled" state, i.e., it's "available" to be set back to 0.
this->set (1);
return 0;
}
@@ -193,6 +196,9 @@ ACE_ALLOC_HOOK_DEFINE(ACE_TSS)
template <class TYPE>
ACE_TSS<TYPE>::~ACE_TSS (void)
{
+ // 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);
}
@@ -531,7 +537,7 @@ ACE_TSS_Guard<LOCK>::~ACE_TSS_Guard (void)
#if defined (ACE_HAS_THR_C_DEST)
ACE_TSS_Adapter *tss_adapter = 0;
ACE_Thread::getspecific (this->key_, (void **) &tss_adapter);
- guard = (ACE_Guard<LOCK> *)tss_adapter->ts_obj_;
+ guard = (ACE_Guard<LOCK> *) tss_adapter->ts_obj_;
#else
ACE_Thread::getspecific (this->key_, (void **) &guard);
#endif /* ACE_HAS_THR_C_DEST */