summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-12-04 17:58:24 +0000
committerChristopher Faylor <me@cgf.cx>2011-12-04 17:58:24 +0000
commit8f937028d9b8d387cf35b64d92056241bffabd78 (patch)
tree2ed73616733809fc902b1e33bc2370a0468ba142 /winsup/cygwin/fhandler.cc
parent69864e48cb0ef1efd1ac29a80b34bbc9c604533b (diff)
downloadcygnal-8f937028d9b8d387cf35b64d92056241bffabd78.tar.gz
cygnal-8f937028d9b8d387cf35b64d92056241bffabd78.tar.bz2
cygnal-8f937028d9b8d387cf35b64d92056241bffabd78.zip
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 6049036b5..a29b1f235 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -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;
}
}