diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-09 09:01:22 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-09 09:01:22 +0000 |
commit | a3dc781d343bffbb4e6bea466b1e19810830b395 (patch) | |
tree | d75b814c2161e18201e9eb27b62c45daa9249418 /ACE/ace/Object_Manager.cpp | |
parent | 18400a28ac86d9a72942b3541aeab03161a3cbd6 (diff) | |
download | ATCD-a3dc781d343bffbb4e6bea466b1e19810830b395.tar.gz |
Fri Nov 9 08:58:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/ace/Object_Manager.cpp')
-rw-r--r-- | ACE/ace/Object_Manager.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/ACE/ace/Object_Manager.cpp b/ACE/ace/Object_Manager.cpp index 086e1a22d80..d5cfc2eb357 100644 --- a/ACE/ace/Object_Manager.cpp +++ b/ACE/ace/Object_Manager.cpp @@ -236,7 +236,11 @@ ACE_Object_Manager::init (void) # if defined (ACE_HAS_TSS_EMULATION) // Initialize the main thread's TS storage. - ACE_TSS_Emulation::tss_open (ts_storage_); + if (!ts_storage_initialized_) + { + ACE_TSS_Emulation::tss_open (ts_storage_); + ts_storage_initialized_ = true; + } # endif /* ACE_HAS_TSS_EMULATION */ #if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \ @@ -279,6 +283,30 @@ ACE_Object_Manager::init (void) } } +#if defined (ACE_HAS_TSS_EMULATION) +int +ACE_Object_Manager::init_tss (void) +{ + return ACE_Object_Manager::instance ()->init_tss_i (); +} + +int +ACE_Object_Manager::init_tss_i (void) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, + *instance_->internal_lock_, -1)); + + if (!ts_storage_initialized_) + { + ACE_TSS_Emulation::tss_open (ts_storage_); + ts_storage_initialized_ = true; + } + + return 0; +} + +#endif + ACE_Object_Manager::ACE_Object_Manager (void) // With ACE_HAS_TSS_EMULATION, ts_storage_ is initialized by the call to // ACE_OS::tss_open () in the function body. @@ -290,7 +318,10 @@ ACE_Object_Manager::ACE_Object_Manager (void) #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) , singleton_null_lock_ (0) , singleton_recursive_lock_ (0) -# endif /* ACE_MT_SAFE */ +#endif /* ACE_MT_SAFE */ +#if defined (ACE_HAS_TSS_EMULATION) + , ts_storage_initialized_ (false) +#endif { #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) ACE_NEW (internal_lock_, ACE_Recursive_Thread_Mutex); |