From 16bed5fc099dcbcada6bc2df16a6f6068de42e03 Mon Sep 17 00:00:00 2001 From: bala Date: Wed, 12 Nov 2003 00:16:13 +0000 Subject: ChangeLogTag:Tue Nov 11 18:02:56 2003 Balachandran Natarajan --- ace/TSS_T.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'ace/TSS_T.cpp') 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::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::ts_init (void) const } } - return -1; + return 0; } template @@ -176,8 +176,12 @@ template TYPE * ACE_TSS::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::ts_object (TYPE *new_ts_obj) // 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::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 */ -- cgit v1.2.1