* 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:
@ -1925,11 +1925,8 @@ fhandler_base_overlapped::wait_overlapped (bool inres, bool writing, DWORD *byte
|
||||
}
|
||||
if (res == overlapped_unknown)
|
||||
{
|
||||
HANDLE w4[3] = { get_overlapped ()->hEvent, signal_arrived,
|
||||
pthread::get_cancel_event () };
|
||||
DWORD n = w4[2] ? 3 : 2;
|
||||
HANDLE h = writing ? get_output_handle () : get_handle ();
|
||||
DWORD wfres = WaitForMultipleObjects (n, w4, false, INFINITE);
|
||||
DWORD wfres = cygWFMO (1, INFINITE, get_overlapped ()->hEvent);
|
||||
/* Cancelling here to prevent races. It's possible that the I/O has
|
||||
completed already, in which case this is a no-op. Otherwise,
|
||||
WFMO returned because 1) This is a non-blocking call, 2) a signal
|
||||
@ -1960,7 +1957,7 @@ fhandler_base_overlapped::wait_overlapped (bool inres, bool writing, DWORD *byte
|
||||
pthread::static_cancel_self (); /* never returns */
|
||||
else
|
||||
{
|
||||
debug_printf ("GetOverLappedResult failed, h %p, bytes %u, w4: %p, %p, %p %E", h, *bytes, w4[0], w4[1], w4[2]);
|
||||
debug_printf ("GetOverLappedResult failed, h %p, bytes %u, %E", h, *bytes);
|
||||
res = overlapped_error;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user