From edc4f86ad282702ab7c029cf65b87ec616bda05e Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 13 Feb 2004 19:34:32 +0000 Subject: * Makefile.in (clean): Remove sigfe.s. (sigfe.s): Ensure that sigfe.s will be regenerated if it does not exist. * dll_init.cc (dll_dllcrt0): Simplify initializing tests. * exceptions.cc (setup_handler): Detect when stub caller is either spinning or has acquired the lock after being suspended to avoid windows problems with suspending a win32 API call. * cygtls.h (_cygtls::spinning): Declare new element. * gendef: Remove unused _siglist_index and _siglist declaration. (_sigfe): Set spinning element when potentially looping, waiting for lock. (_sigbe): Ditto. (_cygtls::lock): Ditto. (_longjmp): Ditto. * tlsoffsets.h: Regenerate. * pinfo.cc (_pinfo::exit): Set final exit state here. Call sigproc_terminate if invoked with 'norecord'. Clear any residual _cygtls stuff. * winsup.h (exit_states): Define ES_FINAL. * spawn.cc (spawn_guts): Don't call proc_terminate specifically when execing. Let _pinfo::exit handle that case. * sigproc.cc (wait_subproc): Always exit loop early when proc_loop_wait. * init.cc (munge_threadfunc): Eliminate unused argument. (dll_entry): Reflect above change in call to munge_threadfunc. --- winsup/cygwin/pinfo.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/pinfo.cc') diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index a9a0b80e7..0dd465ae4 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -31,6 +31,7 @@ details. */ #include "cygheap.h" #include "fhandler.h" #include "cygmalloc.h" +#include "cygtls.h" static char NO_COPY pinfo_dummy[sizeof (_pinfo)] = {0}; @@ -104,6 +105,10 @@ pinfo_init (char **envp, int envc) void _pinfo::exit (UINT n, bool norecord) { + exit_state = ES_FINAL; + cygthread::terminate (); + if (norecord) + sigproc_terminate (); if (this) { if (!norecord) @@ -116,8 +121,9 @@ _pinfo::exit (UINT n, bool norecord) add_rusage (&rusage_self, &r); } - cygthread::terminate (); sigproc_printf ("Calling ExitProcess %d", n); + _my_tls.stacklock = 0; + _my_tls.stackptr = _my_tls.stack; ExitProcess (n); } -- cgit v1.2.3