diff options
author | simonmar <unknown> | 2004-03-15 12:32:11 +0000 |
---|---|---|
committer | simonmar <unknown> | 2004-03-15 12:32:11 +0000 |
commit | b2bc3ad78e48f172d11113f32ff225e25404a87b (patch) | |
tree | 3fe2870d78a9d503affce62e7f59d9ec0a3e7ee3 /ghc/rts/win32 | |
parent | 00912bda4c438c9f6a526e6c2d79cc581e7fbc6a (diff) | |
download | haskell-b2bc3ad78e48f172d11113f32ff225e25404a87b.tar.gz |
[project @ 2004-03-15 12:32:11 by simonmar]
Sync up with the stable branch (small change to the way worker threads
exit that sneaked onto the branch by mistake).
Diffstat (limited to 'ghc/rts/win32')
-rw-r--r-- | ghc/rts/win32/IOManager.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ghc/rts/win32/IOManager.c b/ghc/rts/win32/IOManager.c index ca5fd4d684..c08c4e3014 100644 --- a/ghc/rts/win32/IOManager.c +++ b/ghc/rts/win32/IOManager.c @@ -70,6 +70,11 @@ IOWorkerProc(PVOID param) */ rc = WaitForMultipleObjects( 2, hWaits, FALSE, INFINITE ); + if (rc == WAIT_OBJECT_0) { + // we received the exit event + return 0; + } + EnterCriticalSection(&iom->manLock); /* Signal that the thread is 'non-idle' and about to consume * a work item. @@ -78,10 +83,7 @@ IOWorkerProc(PVOID param) iom->queueSize--; LeaveCriticalSection(&iom->manLock); - if ( WAIT_OBJECT_0 == rc ) { - /* shutdown */ - return 0; - } else if ( (WAIT_OBJECT_0 + 1) == rc ) { + if ( rc == (WAIT_OBJECT_0 + 1) ) { /* work item available, fetch it. */ if (FetchWork(pq,(void**)&work)) { if ( work->workKind & WORKER_READ ) { |