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.
This commit is contained in:
Christopher Faylor
2005-09-23 23:37:52 +00:00
parent 1b19d74296
commit 5e477e9a9b
5 changed files with 26 additions and 57 deletions

View File

@ -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