diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-10-10 00:28:41 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-10-10 00:28:41 +0000 |
commit | 301834a80b03812e57d73195aca0de5d8694ea1d (patch) | |
tree | 97b152ddc4169fc350ad9f37433e542daf4dc662 /ace/OS.cpp | |
parent | 14a7b67ca087bf60cefa0af90d03defb4ea9adc5 (diff) | |
download | ATCD-301834a80b03812e57d73195aca0de5d8694ea1d.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/OS.cpp')
-rw-r--r-- | ace/OS.cpp | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/ace/OS.cpp b/ace/OS.cpp index 12cdab11170..7e917e2283a 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -1396,6 +1396,20 @@ ACE_Thread_Adapter::invoke (void) // Delete ourselves since we don't need <this> anymore. delete (void *) this; +#if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) + void *status = 0; + + ACE_SEH_TRY { + status = (void*) (*func) (arg); // Call thread entry point. + } + ACE_SEH_EXCEPT (EXCEPTION_EXECUTE_HANDLER) { + ACE_DEBUG ((LM_DEBUG, "(%t) Win32 structured exception exiting thread\n")); + // Here's where we might want to provide a hook to report this... + // As it stands now, we just catch all Win32 structured exceptions + // so that we can make sure to clean up correctly when the thread + // exits. + } + #if 0 if (func == ACE_Task_Base::svc_run) { @@ -1412,20 +1426,6 @@ ACE_Thread_Adapter::invoke (void) } #endif /* 0 */ -#if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) - void *status = 0; - - ACE_SEH_TRY { - status = (void*) (*func) (arg); // Call thread entry point. - } - ACE_SEH_EXCEPT (EXCEPTION_EXECUTE_HANDLER) { - ACE_DEBUG ((LM_DEBUG, "(%t) Win32 structured exception exiting thread\n")); - // Here's where we might want to provide a hook to report this... - // As it stands now, we just catch all Win32 structured exceptions - // so that we can make sure to clean up correctly when the thread - // exits. - } - // If dropped off end, call destructors for thread-specific storage. ACE_TSS_Cleanup::instance ()->exit (status); @@ -1442,9 +1442,26 @@ ACE_Thread_Adapter::invoke (void) # endif /* ACE_WIN32 && ACE_HAS_MFC && ACE_HAS_MFS != 0*/ return status; - #else - return (void *) (*func) (arg); // Call thread entry point. + void *result = (void *) (*func) (arg); // Call thread entry point. + +#if 0 + if (func == ACE_Task_Base::svc_run) + { + ACE_Task_Base *task_ptr = (ACE_Task_Base *) arg; + ACE_Thread_Manager *thr_mgr_ptr = task_ptr->thr_mgr (); + + // This calls the <Task->close> hook. + task_ptr->cleanup (task_ptr, 0); + + // This prevents a second invocation of the cleanup code (called + // later by ACE_Thread_Manager::exit()). + + thr_mgr_ptr->at_exit (task_ptr, NULL, 0); + } +#endif /* 0 */ + + return result; #endif /* ACE_WIN32 || ACE_HAS_TSS_EMULATION */ } |