Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-12-09 20:02:56 +0400
committerChristopher Faylor <me@cgf.cx>2011-12-09 20:02:56 +0400
commit57af01797e53a7a15187fa8ee8b1cad693116dd3 (patch)
tree8d3ea456998f0d95e3c81e932ef2df4f171099c7 /winsup/cygwin/sigproc.h
parentaaaaefc09030a8a047bf0a0ab112647ee8307af6 (diff)
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.
Diffstat (limited to 'winsup/cygwin/sigproc.h')
-rw-r--r--winsup/cygwin/sigproc.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h
index 21293ccb9..66507e6e0 100644
--- a/winsup/cygwin/sigproc.h
+++ b/winsup/cygwin/sigproc.h
@@ -81,8 +81,8 @@ void __stdcall sigproc_init ();
#ifdef __INSIDE_CYGWIN__
void __stdcall sigproc_terminate (enum exit_states);
-static inline
-DWORD cygWFMO (DWORD n, DWORD howlong, ...)
+static inline DWORD
+cygwait (DWORD n, DWORD howlong, ...)
{
va_list ap;
va_start (ap, howlong);
@@ -96,6 +96,18 @@ DWORD cygWFMO (DWORD n, DWORD howlong, ...)
n--;
return WaitForMultipleObjects (n, w4, FALSE, howlong);
}
+
+static inline DWORD
+cygwait (HANDLE h, DWORD wait = INFINITE)
+{
+ return cygwait (1, wait, h);
+}
+
+static inline DWORD
+cygwait (DWORD wait)
+{
+ return cygwait ((DWORD) 0, wait);
+}
#endif
bool __stdcall pid_exists (pid_t) __attribute__ ((regparm(1)));
int __stdcall sig_send (_pinfo *, siginfo_t&, class _cygtls *tls = NULL) __attribute__ ((regparm (3)));