diff options
author | Christopher Faylor <me@cgf.cx> | 2012-06-19 00:31:15 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-06-19 00:31:15 +0000 |
commit | af5cd145835d35519af02d0d226f67eb777e4945 (patch) | |
tree | d31ebb964550d4e73c3f0d63d3fa0d1b502e44f4 /winsup/cygwin/posix_ipc.cc | |
parent | 88fbcb5afd6d7d687387b22509037d99e2aa07ff (diff) | |
download | cygnal-af5cd145835d35519af02d0d226f67eb777e4945.tar.gz cygnal-af5cd145835d35519af02d0d226f67eb777e4945.tar.bz2 cygnal-af5cd145835d35519af02d0d226f67eb777e4945.zip |
* cygwait.cc (cancelable_wait): Mimic old cygwait behavior more closely wrt
handling of call_signal_handler.
* cygwait.h (WAIT_CANCELED): Move here and redefine.
(WAIT_SIGNALED): Ditto.
* thread.h (WAIT_CANCELED): Delete.
(WAIT_SIGNALED): Ditto.
Diffstat (limited to 'winsup/cygwin/posix_ipc.cc')
-rw-r--r-- | winsup/cygwin/posix_ipc.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index b9d224e43..b427d11d6 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -119,14 +119,12 @@ ipc_mutex_init (HANDLE *pmtx, const char *name) static int ipc_mutex_lock (HANDLE mtx) { - HANDLE h[2] = { mtx, signal_arrived }; - - switch (WaitForMultipleObjects (2, h, FALSE, INFINITE)) + switch (cancelable_wait (mtx, NULL, cw_sig_eintr | cw_cancel | cw_cancel_self)) { case WAIT_OBJECT_0: case WAIT_ABANDONED_0: return 0; - case WAIT_OBJECT_0 + 1: + case WAIT_SIGNALED: set_errno (EINTR); return 1; default: @@ -174,11 +172,12 @@ ipc_cond_init (HANDLE *pevt, const char *name, char sr) static int ipc_cond_timedwait (HANDLE evt, HANDLE mtx, const struct timespec *abstime) { - HANDLE w4[4] = { evt, signal_arrived, NULL, NULL }; + HANDLE w4[4] = { evt, }; DWORD cnt = 2; DWORD timer_idx = 0; int ret = 0; + set_thread_waiting (w4[1]); if ((w4[cnt] = pthread::get_cancel_event ()) != NULL) ++cnt; if (abstime) |