* sigproc.cc (close_my_readsig): New function.
(_cygtls::signal_exit): Close my_readsig via close_my_readsig(), avoiding communication with the signal pipe. (wait_sig): Close my_readsig via close_my_readsig().
This commit is contained in:
parent
8912b2e56f
commit
08d944e19f
|
@ -1,3 +1,10 @@
|
||||||
|
2011-12-05 Christopher Faylor <me.cygwin2011@cgf.cx>
|
||||||
|
|
||||||
|
* sigproc.cc (close_my_readsig): New function.
|
||||||
|
(_cygtls::signal_exit): Close my_readsig via close_my_readsig(),
|
||||||
|
avoiding communication with the signal pipe.
|
||||||
|
(wait_sig): Close my_readsig via close_my_readsig().
|
||||||
|
|
||||||
2011-12-05 Corinna Vinschen <vinschen@redhat.com>
|
2011-12-05 Corinna Vinschen <vinschen@redhat.com>
|
||||||
|
|
||||||
* mmap.cc (mlock): Replace LOCK_VM_IN_WSL with correct MAP_PROCESS.
|
* mmap.cc (mlock): Replace LOCK_VM_IN_WSL with correct MAP_PROCESS.
|
||||||
|
|
|
@ -360,6 +360,14 @@ _cygtls::remove_wq (DWORD wait)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
close_my_readsig ()
|
||||||
|
{
|
||||||
|
HANDLE h;
|
||||||
|
if ((h = InterlockedExchangePointer (&my_readsig, NULL)))
|
||||||
|
ForceCloseHandle1 (h, my_readsig);
|
||||||
|
}
|
||||||
|
|
||||||
/* Cover function to `do_exit' to handle exiting even in presence of more
|
/* Cover function to `do_exit' to handle exiting even in presence of more
|
||||||
exceptions. We used to call exit, but a SIGSEGV shouldn't cause atexit
|
exceptions. We used to call exit, but a SIGSEGV shouldn't cause atexit
|
||||||
routines to run. */
|
routines to run. */
|
||||||
|
@ -368,17 +376,8 @@ _cygtls::signal_exit (int rc)
|
||||||
{
|
{
|
||||||
extern void stackdump (DWORD, int, bool);
|
extern void stackdump (DWORD, int, bool);
|
||||||
|
|
||||||
HANDLE myss = my_sendsig;
|
|
||||||
my_sendsig = NULL; /* Make no_signals_allowed return true */
|
my_sendsig = NULL; /* Make no_signals_allowed return true */
|
||||||
if (&_my_tls == _sig_tls)
|
close_my_readsig ();
|
||||||
ForceCloseHandle (my_readsig); /* Stop any currently executing sig_sends */
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sigpacket sp = {};
|
|
||||||
sp.si.si_signo = __SIGEXIT;
|
|
||||||
DWORD len;
|
|
||||||
WriteFile (myss, &sp, sizeof (sp), &len, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetEvent (signal_arrived); /* Avoid potential deadlock with proc_lock */
|
SetEvent (signal_arrived); /* Avoid potential deadlock with proc_lock */
|
||||||
|
|
||||||
|
@ -1422,7 +1421,7 @@ wait_sig (VOID *)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ForceCloseHandle (my_readsig);
|
close_my_readsig ();
|
||||||
sigproc_printf ("signal thread exiting");
|
sigproc_printf ("signal thread exiting");
|
||||||
ExitThread (0);
|
ExitThread (0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue