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>2012-06-19 04:31:15 +0400
committerChristopher Faylor <me@cgf.cx>2012-06-19 04:31:15 +0400
commitaf5cd145835d35519af02d0d226f67eb777e4945 (patch)
treed31ebb964550d4e73c3f0d63d3fa0d1b502e44f4 /winsup/cygwin/posix_ipc.cc
parent88fbcb5afd6d7d687387b22509037d99e2aa07ff (diff)
* 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.cc9
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)