* exceptions.cc (exception::handle): Drop abbreviation for "exception" since I
never remember what it stands for. (sig_handle_tty_stop): Remove obsolete call to sig_handle_tty_stop. (_cygtls::call_signal_handler): Rework to grab signal information from _main_tls if none is set for _my_tls. Try harder to keep thread locked. (reset_signal_arrived): Delete. * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use new cygWFMO call to wait for an event + standard cygwin stuff. Modify debug output to acccomodate new function. * fhandler_console.cc (fhandler_console::read): Replace WaitForMultipleObjects with cygWFMO. * fhandler_socket.cc (get_inet_addr): Add comment. * gendef (_sigdelayed): Remove call to reset_signal_arrived. * sigproc.cc (_cygtls::signal_exit): Don't close my_readsig here unless we're in the signal thread. (create_signal_arrived): Create signal_arrived as auto-reset so that only one thread is woken when a signal arrives. * sigproc.h (cygWFMO): New function. (reset_signal_arrived): Delete declaration.
This commit is contained in:
@ -368,8 +368,18 @@ _cygtls::signal_exit (int rc)
|
||||
{
|
||||
extern void stackdump (DWORD, int, bool);
|
||||
|
||||
HANDLE myss = my_sendsig;
|
||||
my_sendsig = NULL; /* Make no_signals_allowed return true */
|
||||
ForceCloseHandle (my_readsig); /* Stop any currently executing sig_sends */
|
||||
if (&_my_tls == _sig_tls)
|
||||
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 */
|
||||
|
||||
if (rc == SIGQUIT || rc == SIGABRT)
|
||||
@ -493,7 +503,7 @@ create_signal_arrived ()
|
||||
return;
|
||||
/* local event signaled when main thread has been dispatched
|
||||
to a signal handler function. */
|
||||
signal_arrived = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
|
||||
signal_arrived = CreateEvent (&sec_none_nih, false, false, NULL);
|
||||
ProtectHandle (signal_arrived);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user