diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-02 23:05:57 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-02 23:05:57 +0000 |
commit | 7ae1b6276735e1349df825ced24a86da1f091834 (patch) | |
tree | 3096a59bd39498a2e7b72619d68e82068d979c1e /ace/Thread_Manager.cpp | |
parent | b37b2be53108ec23c8f5bd8211663ee3d36d5f90 (diff) | |
download | ATCD-7ae1b6276735e1349df825ced24a86da1f091834.tar.gz |
Added Win32 thread exit functionality.
Diffstat (limited to 'ace/Thread_Manager.cpp')
-rw-r--r-- | ace/Thread_Manager.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index d81c30aaf87..3c48941cbe8 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -1266,6 +1266,20 @@ ACE_Thread_Manager::exit (void *status, int do_thr_exit) { ACE_TRACE ("ACE_Thread_Manager::exit"); +#if defined (ACE_WIN32) + if (do_thr_exit) + { + // On Win32, if we really wants to exit from a thread, we must + // first clean up the thread specific storage. By doing so, + // ACE_Thread_Manager::exit will be called again with + // do_thr_exit = 0 and cleaning up the ACE_Cleanup_Info (but not + // exiting the thread.) After the following call returns, we + // are safe to exit this thread. + delete ACE_Thread_Exit::instance (); + ACE_Thread::exit (status); + } +#endif /* ACE_WIN32 */ + ACE_Cleanup_Info cleanup_info; // Just hold onto the guard while finding this thread's id and @@ -1749,7 +1763,7 @@ ACE_Thread_Control::~ACE_Thread_Control (void) { ACE_TRACE ("ACE_Thread_Control::~ACE_Thread_Control"); -#if defined (ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS) || defined (ACE_HAS_TSS_EMULATION) +#if defined (ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS) || defined (ACE_HAS_TSS_EMULATION) || defined (ACE_WIN32) this->exit (this->status_, 0); #else this->exit (this->status_, 1); |