diff options
Diffstat (limited to 'ace/OS.cpp')
-rw-r--r-- | ace/OS.cpp | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/ace/OS.cpp b/ace/OS.cpp index d0c0d7dfe85..ab24f321d02 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -1997,33 +1997,29 @@ ACE_Thread_Adapter::invoke (void) this->inherit_log_msg (); #if !defined(ACE_USE_THREAD_MANAGER_ADAPTER) - // NOTE: this preprocessor directive should match the one in - // above ACE_Thread_Exit::instance (). With the Xavier Pthreads - // package, the exit_hook in TSS causes a seg fault. So, this - // works around that by creating exit_hook on the stack. -# if (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) && ! defined (ACE_HAS_PTHREAD_SIGMASK) - // Obtain our thread-specific exit hook and make sure that it - // knows how to clean us up! Note that we never use this - // pointer directly (it's stored in thread-specific storage), so - // it's ok to dereference it here and only store it as a - // reference. - if (this->thr_mgr () != 0) - { - 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 ()); - } -# else + // NOTE: this preprocessor directive should match the one in above + // ACE_Thread_Exit::instance (). With the Xavier Pthreads package, + // the exit_hook in TSS causes a seg fault. So, this works around + // that by creating exit_hook on the stack. +#if (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) && ! defined (ACE_HAS_PTHREAD_SIGMASK) + // Obtain our thread-specific exit hook and make sure that it knows + // how to clean us up! Note that we never use this pointer directly + // (it's stored in thread-specific storage), so it's ok to + // dereference it here and only store it as a reference. + ACE_Thread_Exit &exit_hook = *ACE_Thread_Exit::instance (); +#else // Without TSS, create an <ACE_Thread_Exit> instance. When this // function returns, its destructor will be called because the // object goes out of scope. The drawback with this appraoch is - // that the destructor _won't_ get called if <thr_exit> is - // called. So, threads shouldn't exit that way. Instead, they - // should return from <svc>. + // that the destructor _won't_ get called if <thr_exit> is called. + // So, threads shouldn't exit that way. Instead, they should return + // from <svc>. ACE_Thread_Exit exit_hook; -# endif /* (ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION) && ! ACE_HAS_PTHREAD_SIGMASK */ +#endif /* (ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION) && ! ACE_HAS_PTHREAD_SIGMASK */ + // Keep track of the <Thread_Manager> that's associated with this + // <exit_hook>. + exit_hook.thr_mgr (this->thr_mgr ()); #endif // Extract the arguments. |