diff options
author | Christopher Faylor <me@cgf.cx> | 2011-12-11 05:25:20 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-12-11 05:25:20 +0400 |
commit | fc25f200f473a79294ee9ab195e431b211aadf73 (patch) | |
tree | c4afa79be8112ff1d58394bb7f70c11eca56d6f3 /winsup/cygwin/sigproc.h | |
parent | 14bb21fe45326a3397c3b1983ea0a0477044580e (diff) |
* select.cc (select_stuff::wait): Very minor formatting fix.
(peek_windows): Report on HWND handle used in queries.
* select.h: Update copyright.
* sigproc.h (cygwait): Eliminate multi-argument variety since more general
implementation may cause odd problems in select. Also force to always be
inline.
Diffstat (limited to 'winsup/cygwin/sigproc.h')
-rw-r--r-- | winsup/cygwin/sigproc.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index b0817360c..72427a4c2 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -81,33 +81,23 @@ void __stdcall sigproc_init (); #ifdef __INSIDE_CYGWIN__ void __stdcall sigproc_terminate (enum exit_states); -static inline DWORD -cygwait (DWORD n, DWORD howlong, ...) +static inline DWORD __attribute__ ((always_inline)) +cygwait (HANDLE h, DWORD howlong = INFINITE) { - va_list ap; - HANDLE w4[n + 2]; - - va_start (ap, howlong); - for (unsigned i = 0; i < n; i++) - w4[i] = va_arg (ap, HANDLE); - va_end (ap); - + HANDLE w4[3]; + int n = 0; + if ((w4[n] = h) != NULL) + n++; w4[n++] = signal_arrived; if ((w4[n] = pthread::get_cancel_event ()) != NULL) n++; return WaitForMultipleObjects (n, w4, FALSE, howlong); } -static inline DWORD -cygwait (HANDLE h, DWORD wait = INFINITE) -{ - return cygwait (1, wait, h); -} - -static inline DWORD +static inline DWORD __attribute__ ((always_inline)) cygwait (DWORD wait) { - return cygwait ((DWORD) 0, wait); + return cygwait ((HANDLE) NULL, wait); } #endif bool __stdcall pid_exists (pid_t) __attribute__ ((regparm(1))); |