From: Simon Marlow Date: Wed, 11 Mar 2009 15:45:59 +0000 (+0000) Subject: avoid a crash: don't return unless the run queue has some threads in it X-Git-Tag: 2009-03-13~1 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=c5e9e31045f8f96a87c0d0793af33cb83c3da5d7 avoid a crash: don't return unless the run queue has some threads in it --- diff --git a/rts/win32/AwaitEvent.c b/rts/win32/AwaitEvent.c index 2175626..1b92c43 100644 --- a/rts/win32/AwaitEvent.c +++ b/rts/win32/AwaitEvent.c @@ -45,14 +45,11 @@ awaitEvent(rtsBool wait) return; } - if (!ret) { - return; /* still hold the lock */ - } - - // Return to the scheduler if: + // The return value from awaitRequests() is a red herring: ignore + // it. Return to the scheduler if !wait, or // // - we were interrupted - // - new threads have arrived + // - the run-queue is now non- empty } while (wait && sched_state == SCHED_RUNNING