* 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:
Christopher Faylor
2011-12-04 17:58:24 +00:00
parent 69864e48cb
commit 8f937028d9
8 changed files with 82 additions and 31 deletions

View File

@ -59,6 +59,21 @@ struct sigpacket
};
extern HANDLE signal_arrived;
static inline
DWORD cygWFMO (DWORD n, DWORD howlong, ...)
{
va_list ap;
va_start (ap, howlong);
HANDLE w4[n + 2];
va_start (ap, howlong);
unsigned i;
for (i = 0; i < n; i++)
w4[i] = va_arg (ap, HANDLE);
w4[i++] = signal_arrived;
w4[i++] = pthread::get_cancel_event ();
return WaitForMultipleObjects (n, w4, FALSE, howlong);
}
extern HANDLE sigCONT;
void __stdcall sig_dispatch_pending (bool fast = false);
@ -69,7 +84,6 @@ int __stdcall handle_sigprocmask (int sig, const sigset_t *set,
sigset_t *oldset, sigset_t& opmask)
__attribute__ ((regparm (3)));
extern "C" void __stdcall reset_signal_arrived ();
void __stdcall sig_clear (int) __attribute__ ((regparm (1)));
void __stdcall sig_set_pending (int) __attribute__ ((regparm (1)));
int __stdcall handle_sigsuspend (sigset_t);