X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fwin32%2FAwaitEvent.c;h=1b92c4386f483807721439d3e018671c2c15a5d4;hb=c5e9e31045f8f96a87c0d0793af33cb83c3da5d7;hp=43e188fb34a8444ac14d5fe7a15c7f99ec637a58;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/rts/win32/AwaitEvent.c b/rts/win32/AwaitEvent.c index 43e188f..1b92c43 100644 --- a/rts/win32/AwaitEvent.c +++ b/rts/win32/AwaitEvent.c @@ -18,6 +18,7 @@ #include "AwaitEvent.h" #include #include "win32/AsyncIO.h" +#include "win32/ConsoleHandler.h" // Used to avoid calling abandonRequestWait() if we don't need to. // Protected by sched_mutex. @@ -34,14 +35,21 @@ awaitEvent(rtsBool wait) workerWaitingForRequests = 1; ret = awaitRequests(wait); workerWaitingForRequests = 0; - if (!ret) { - return; /* still hold the lock */ + + // If a signal was raised, we need to service it + // XXX the scheduler loop really should be calling + // startSignalHandlers(), but this is the way that posix/Select.c + // does it and I'm feeling too paranoid to refactor it today --SDM + if (stg_pending_events != 0) { + startSignalHandlers(&MainCapability); + return; } - // 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