diff options
author | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-03 17:42:20 +0000 |
---|---|---|
committer | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-03 17:42:20 +0000 |
commit | b6d456c9d6cbbdf2052e4058aa1f5e8a6ee5c466 (patch) | |
tree | 2b4cfe48c805615a7494776b2625017666c90802 /ace/Thread_Adapter.cpp | |
parent | 26748c3516744d69e95ad82a5a9948b080d84618 (diff) | |
download | ATCD-b6d456c9d6cbbdf2052e4058aa1f5e8a6ee5c466.tar.gz |
Altered code to use a smartish pointer.
Diffstat (limited to 'ace/Thread_Adapter.cpp')
-rw-r--r-- | ace/Thread_Adapter.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/ace/Thread_Adapter.cpp b/ace/Thread_Adapter.cpp index d1930f2db26..69696552643 100644 --- a/ace/Thread_Adapter.cpp +++ b/ace/Thread_Adapter.cpp @@ -62,22 +62,15 @@ ACE_Thread_Adapter::invoke (void) // Except if it is null, then the thr_mgr() method crashes. // -jxh + ACE_Thread_Exit *exit_hook_instance = ACE_Thread_Exit::instance (); + ACE_Thread_Exit_Maybe exit_hook_maybe (exit_hook_instance == 0); + ACE_Thread_Exit *exit_hook_ptr = exit_hook_instance + ? exit_hook_instance + : exit_hook_maybe.instance (); + ACE_Thread_Exit &exit_hook = *exit_hook_ptr; + 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>. exit_hook.thr_mgr (this->thr_mgr ()); |