summaryrefslogtreecommitdiff
path: root/ace/Thread_Adapter.cpp
diff options
context:
space:
mode:
authorjxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-03 01:54:05 +0000
committerjxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-03 01:54:05 +0000
commit9ae88fed1ae7b087597035791de4b5ab36de272c (patch)
treecc5d63f9c4f2ccc87aab30b45527e0ffaa8cf821 /ace/Thread_Adapter.cpp
parentb0895ef72f4ce7f97b4c9e91afe558d1da1d4268 (diff)
downloadATCD-9ae88fed1ae7b087597035791de4b5ab36de272c.tar.gz
Detect of TSS instance of ACE_Thread_Exit fails to create.
Diffstat (limited to 'ace/Thread_Adapter.cpp')
-rw-r--r--ace/Thread_Adapter.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/ace/Thread_Adapter.cpp b/ace/Thread_Adapter.cpp
index 5c29550410e..337031226cf 100644
--- a/ace/Thread_Adapter.cpp
+++ b/ace/Thread_Adapter.cpp
@@ -59,8 +59,25 @@ ACE_Thread_Adapter::invoke (void)
// pointer directly (it's stored in thread-specific storage), so
// it's ok to dereference it here and only store it as a
// reference.
+
+ // Except if it is null, then the thr_mgr() method crashes.
+ // -jxh
+
if (this->thr_mgr () != 0)
{
+ ACE_Thread_Exit *exit_hook_instance = ACE_Thread_Exit::instance ();
+ if (exit_hook_instance == 0)
+ {
+ // Using a ACE_Thread_Exit that was created off the
+ // stack gives NT problems. So, instead, we wait
+ // half a second and then try again.
+
+ ACE_OS::sleep (ACE_Time_Value (0, 500000));
+ exit_hook_instance = ACE_Thread_Exit::instance ();
+
+ // ACE_ASSERT (exit_hook_instance);
+ }
+
ACE_Thread_Exit &exit_hook = *ACE_Thread_Exit::instance ();
// Keep track of the <Thread_Manager> that's associated with this
// <exit_hook>.