summaryrefslogtreecommitdiff
path: root/ACE/ace/Object_Manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/Object_Manager.cpp')
-rw-r--r--ACE/ace/Object_Manager.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/ACE/ace/Object_Manager.cpp b/ACE/ace/Object_Manager.cpp
index 086e1a22d80..313eb6a116a 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) && \
@@ -247,6 +251,9 @@ ACE_Object_Manager::init (void)
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
#endif /* _DEBUG && _MSC_VER || __INTEL_COMPILER */
+ // The system does not display the critical-error-handler message box
+ SetErrorMode(SEM_FAILCRITICALERRORS);
+
// And this will catch all unhandled exceptions.
SetUnhandledExceptionFilter (&ACE_UnhandledExceptionFilter);
#endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE */
@@ -279,6 +286,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 +321,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);