diff options
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))); |