diff options
author | Christopher Faylor <me@cgf.cx> | 2005-09-23 23:37:52 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-09-23 23:37:52 +0000 |
commit | 5e477e9a9b0bf9597f8f9a829edfe554ee97b140 (patch) | |
tree | 3de620f8769d15f51065ea593c5b12381bcf3714 /winsup/cygwin/exceptions.cc | |
parent | 1b19d7429605f4879186aa3eb0214e2c22bc4530 (diff) | |
download | cygnal-5e477e9a9b0bf9597f8f9a829edfe554ee97b140.tar.gz cygnal-5e477e9a9b0bf9597f8f9a829edfe554ee97b140.tar.bz2 cygnal-5e477e9a9b0bf9597f8f9a829edfe554ee97b140.zip |
Semi-reversion of always-exit-from-sigthread change of 2005-09-15.
* exceptions.cc (sigpacket::process): Eliminate return after call to reinstated
noreturn function.
(signal_exit): Allow function to exit when a captive process has been
terminated.
* pinfo.cc (pinfo::exit): Enter exit_lock here. Once again exit here under
control of exit_lock.
* sigproc.cc (sig_send): Don't wait for completion if process is exiting.
Remove special __SIGEXIT accommodations.
(wait_sig): Just exit the thread when a __SIGEXIT has been detected. Don't
exit the process.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 79cc251a3..c51dd0b1a 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -40,7 +40,7 @@ extern NO_COPY DWORD dwExeced; int NO_COPY sigExeced; static BOOL WINAPI ctrl_c_handler (DWORD); -static void signal_exit (int); +static void signal_exit (int) __attribute__ ((noreturn)); char windows_system_directory[1024]; static size_t windows_system_directory_length; @@ -1160,9 +1160,7 @@ exit_sig: si.si_signo |= 0x80; } sigproc_printf ("signal %d, about to call do_exit", si.si_signo); - signal_exit (si.si_signo); - /* May not return */ - return rc; + signal_exit (si.si_signo); /* never returns */ } CRITICAL_SECTION NO_COPY exit_lock; @@ -1177,11 +1175,10 @@ signal_exit (int rc) { sigproc_printf ("terminating captive process"); TerminateProcess (hExeced, sigExeced = rc); - return; } EnterCriticalSection (&exit_lock); - if (exit_already++) + if (hExeced || exit_state) myself.exit (rc); /* We'd like to stop the main thread from executing but when we do that it |