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>2005-06-09 09:14:02 +0400
committerChristopher Faylor <me@cgf.cx>2005-06-09 09:14:02 +0400
commitabf60784bea59b12dbbb6392fe8a37bbff6782a6 (patch)
treea631c4abb1719f903ebc147b626ac2200bc8e259 /winsup/cygwin/thread.cc
parented364fa9fbf461ef2f1b17ba17f210dd1066f6b3 (diff)
* thread.cc (cancelable_wait): No-op change to make sure that res is always a
valid WFMO return.
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 9a3c7af48..1ba384794 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -623,7 +623,7 @@ cancelable_wait (HANDLE object, DWORD timeout, const bool do_cancel,
cancel_n = (DWORD) -1;
else
{
- cancel_n = num++;
+ cancel_n = WAIT_OBJECT_0 + num++;
wait_objects[cancel_n] = thread->cancel_event;
}
@@ -632,14 +632,13 @@ cancelable_wait (HANDLE object, DWORD timeout, const bool do_cancel,
sig_n = (DWORD) -1;
else
{
- sig_n = num++;
+ sig_n = WAIT_OBJECT_0 + num++;
wait_objects[sig_n] = signal_arrived;
}
while (1)
{
res = WaitForMultipleObjects (num, wait_objects, FALSE, timeout);
- res -= WAIT_OBJECT_0;
if (res == cancel_n)
{
if (do_cancel)