4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-19 07:22:14 +08:00

* thread.cc (cancelable_wait): No-op change to make sure that res is always a

valid WFMO return.
This commit is contained in:
Christopher Faylor 2005-06-09 05:14:02 +00:00
parent ed364fa9fb
commit abf60784be
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2005-06-09 Christopher Faylor <cgf@timesys.com>
* thread.cc (cancelable_wait): No-op change to make sure that res is
always a valid WFMO return.
2005-06-09 Christopher Faylor <cgf@timesys.com> 2005-06-09 Christopher Faylor <cgf@timesys.com>
Change pthread::cancelable_wait to just cancelable_wait, throughout. Change pthread::cancelable_wait to just cancelable_wait, throughout.

View File

@ -623,7 +623,7 @@ cancelable_wait (HANDLE object, DWORD timeout, const bool do_cancel,
cancel_n = (DWORD) -1; cancel_n = (DWORD) -1;
else else
{ {
cancel_n = num++; cancel_n = WAIT_OBJECT_0 + num++;
wait_objects[cancel_n] = thread->cancel_event; 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; sig_n = (DWORD) -1;
else else
{ {
sig_n = num++; sig_n = WAIT_OBJECT_0 + num++;
wait_objects[sig_n] = signal_arrived; wait_objects[sig_n] = signal_arrived;
} }
while (1) while (1)
{ {
res = WaitForMultipleObjects (num, wait_objects, FALSE, timeout); res = WaitForMultipleObjects (num, wait_objects, FALSE, timeout);
res -= WAIT_OBJECT_0;
if (res == cancel_n) if (res == cancel_n)
{ {
if (do_cancel) if (do_cancel)