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>2003-05-09 21:56:58 +0400
committerChristopher Faylor <me@cgf.cx>2003-05-09 21:56:58 +0400
commit9508ebc53d3a542a54d2e7fb3835e9e2567560f8 (patch)
tree47ffb514140818e3dfff2532fb8ae5a07122295e /winsup/cygwin/cygthread.cc
parent8bdd7abed58cfce74390555abba08ca16aa65400 (diff)
* cygthread.cc (cygthread::detach): Prioritize waiting for I/O completion over
waiting for signal delivery.
Diffstat (limited to 'winsup/cygwin/cygthread.cc')
-rw-r--r--winsup/cygwin/cygthread.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index 967717bfd..e3c177e6b 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -283,17 +283,17 @@ cygthread::detach (HANDLE sigwait)
else
{
HANDLE w4[2];
- w4[0] = signal_arrived;
- w4[1] = *this;
+ w4[0] = *this;
+ w4[1] = signal_arrived;
res = WaitForSingleObject (sigwait, INFINITE);
if (res != WAIT_OBJECT_0)
system_printf ("WFSO sigwait %p failed, res %u, %E", sigwait, res);
res = WaitForMultipleObjects (2, w4, FALSE, INFINITE);
- if (res != WAIT_OBJECT_0)
+ if (res == WAIT_OBJECT_0)
/* nothing */;
- else if (WaitForSingleObject (sigwait, 5) == WAIT_OBJECT_0)
+ else if (WaitForSingleObject (sigwait, 0) == WAIT_OBJECT_0)
res = WaitForSingleObject (*this, INFINITE);
- else
+ else if ((res = WaitForSingleObject (*this, 0)) != WAIT_OBJECT_0)
{
signalled = true;
terminate_thread ();