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

@@ -151,31 +151,19 @@ pinfo::exit (DWORD n)
}
sigproc_terminate (ES_FINAL);
zap_cwd ();
/* FIXME: There is a potential race between an execed process and its
parent here. I hated to add a mutex just for that, though. */
struct rusage r;
fill_rusage (&r, hMainProc);
add_rusage (&self->rusage_self, &r);
if (n != EXITCODE_NOSET)
{
zap_cwd ();
self->alert_parent (0); /* Shave a little time by telling our
parent that we have now exited. */
}
int exitcode = self->exitcode & 0xffff;
if (!self->cygstarted)
exitcode >>= 8;
_my_tls.stacklock = 0;
_my_tls.stackptr = _my_tls.stack;
sigproc_printf ("Calling ExitThread hProcess %p, n %p, exitcode %p",
hProcess, n, exitcode);
if (&_my_tls == _sig_tls)
ExitProcess (exitcode);
else
ExitThread (exitcode);
release ();
sigproc_printf ("Calling ExitProcess n %p, exitcode %p", n, exitcode);
ExitProcess (exitcode);
}
# undef self