summaryrefslogtreecommitdiff
path: root/ace/TSS_T.cpp
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-11-12 00:16:13 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-11-12 00:16:13 +0000
commit16bed5fc099dcbcada6bc2df16a6f6068de42e03 (patch)
treedc1869161c6b7e34dfb9d3099c70986f06691b41 /ace/TSS_T.cpp
parentd245c5a2b40f14b8acd9d5b81fe9d2818582d35a (diff)
downloadATCD-16bed5fc099dcbcada6bc2df16a6f6068de42e03.tar.gz
ChangeLogTag:Tue Nov 11 18:02:56 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
Diffstat (limited to 'ace/TSS_T.cpp')
-rw-r--r--ace/TSS_T.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/ace/TSS_T.cpp b/ace/TSS_T.cpp
index c2cb22847c0..ac474228bda 100644
--- a/ace/TSS_T.cpp
+++ b/ace/TSS_T.cpp
@@ -73,7 +73,7 @@ ACE_TSS<TYPE>::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
+#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
#if defined (ACE_HAS_THR_C_DEST)
extern "C" void ACE_TSS_C_cleanup(void *); // defined in Synch.cpp
#endif /* ACE_HAS_THR_C_DEST */
@@ -112,7 +112,7 @@ ACE_TSS<TYPE>::ts_init (void) const
}
}
- return -1;
+ return 0;
}
template <class TYPE>
@@ -176,8 +176,12 @@ template <class TYPE> TYPE *
ACE_TSS<TYPE>::ts_get (void) const
{
if (this->once_ == 0)
- // Create and initialize thread-specific ts_obj.
- this->ts_init ();
+ {
+ // Create and initialize thread-specific ts_obj.
+ if (this->ts_init () == -1)
+ // Seriously wrong..
+ return 0;
+ }
TYPE *ts_obj = 0;
@@ -286,8 +290,11 @@ ACE_TSS<TYPE>::ts_object (TYPE *new_ts_obj)
// <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 ();
+ {
+ // Create and initialize thread-specific ts_obj.
+ if (this->ts_init () == -1)
+ return 0;
+ }
// Ensure that we are serialized!
ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->keylock_, 0);
@@ -682,6 +689,6 @@ ACE_TSS_Read_Guard<ACE_LOCK>::dump (void) const
#endif /* ACE_HAS_DUMP */
}
-#endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) */
+#endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) */
#endif /* ACE_TSS_T_C */