Skip to content
Snippets Groups Projects
Commit b2bc3ad7 authored by Simon Marlow's avatar Simon Marlow
Browse files

[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).
parent 00912bda
No related branches found
Tags Cabal-v1.18.1.5 cabal-install-v1.18.0.6
No related merge requests found
...@@ -70,6 +70,11 @@ IOWorkerProc(PVOID param) ...@@ -70,6 +70,11 @@ IOWorkerProc(PVOID param)
*/ */
rc = WaitForMultipleObjects( 2, hWaits, FALSE, INFINITE ); rc = WaitForMultipleObjects( 2, hWaits, FALSE, INFINITE );
if (rc == WAIT_OBJECT_0) {
// we received the exit event
return 0;
}
EnterCriticalSection(&iom->manLock); EnterCriticalSection(&iom->manLock);
/* Signal that the thread is 'non-idle' and about to consume /* Signal that the thread is 'non-idle' and about to consume
* a work item. * a work item.
...@@ -78,10 +83,7 @@ IOWorkerProc(PVOID param) ...@@ -78,10 +83,7 @@ IOWorkerProc(PVOID param)
iom->queueSize--; iom->queueSize--;
LeaveCriticalSection(&iom->manLock); LeaveCriticalSection(&iom->manLock);
if ( WAIT_OBJECT_0 == rc ) { if ( rc == (WAIT_OBJECT_0 + 1) ) {
/* shutdown */
return 0;
} else if ( (WAIT_OBJECT_0 + 1) == rc ) {
/* work item available, fetch it. */ /* work item available, fetch it. */
if (FetchWork(pq,(void**)&work)) { if (FetchWork(pq,(void**)&work)) {
if ( work->workKind & WORKER_READ ) { if ( work->workKind & WORKER_READ ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment