Rename cygWFMO to cygwait throughout and use the magic of polymorphism to "wait

for stuff".
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use simplified arg
form of cygwait.
* fhandler_console.cc (fhandler_console::read): Ditto.
* fhandler_audio.cc (fhandler_dev_dsp::Audio_out::waitforspac): Ditto.
(fhandler_dev_dsp::Audio_in::waitfordata): Ditto.
* fhandler_fifo.cc (fhandler_fifo::wait): Ditto.
* fhandler_serial.cc (fhandler_serial::raw_read): Ditto.
(fhandler_serial::raw_write): Ditto.
* select.cc (cygwin_select): Ditto.
* sigproc.h (cygwait): Rename from cygWFMO.  Define two argument and single
argument forms of this function.
* fhandler_tty.cc (fhandler_pty_slave::open): Use method to query if tty is
open.
(fhandler_pty_slave::read): Send SIGHUP when master is detected as closed.
(fhandler_pty_common::close): Close input_available_event in callers since
master may need to signal it first.
(fhandler_pty_master::close): Lie and set input_available_event when closing,
then close input_available_event.
(fhandler_pty_slave::close): Close input_available_event explicitly here.
* tty.h (tty::is_master_closed): Declare new method.
This commit is contained in:
Christopher Faylor
2011-12-09 16:02:56 +00:00
parent aaaaefc090
commit 57af01797e
10 changed files with 89 additions and 32 deletions

View File

@@ -1926,7 +1926,7 @@ fhandler_base_overlapped::wait_overlapped (bool inres, bool writing, DWORD *byte
if (res == overlapped_unknown)
{
HANDLE h = writing ? get_output_handle () : get_handle ();
DWORD wfres = cygWFMO (1, INFINITE, get_overlapped ()->hEvent);
DWORD wfres = cygwait (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