diff options
author | Simon Marlow <marlowsd@gmail.com> | 2008-11-13 11:43:42 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2008-11-13 11:43:42 +0000 |
commit | 4a875d65b5c86a77a3051256519f9695d701c3be (patch) | |
tree | 453902656c3adf2d41fd6dc51ff3ab99c87c3711 /rts/win32 | |
parent | 5c9424bb4f530c315d1dde2c53ebb1adfd3a2da4 (diff) | |
download | haskell-4a875d65b5c86a77a3051256519f9695d701c3be.tar.gz |
notice ^C exceptions when waiting for I/O
Diffstat (limited to 'rts/win32')
-rw-r--r-- | rts/win32/AwaitEvent.c | 11 | ||||
-rw-r--r-- | rts/win32/ConsoleHandler.c | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/rts/win32/AwaitEvent.c b/rts/win32/AwaitEvent.c index 43e188fb34..2175626313 100644 --- a/rts/win32/AwaitEvent.c +++ b/rts/win32/AwaitEvent.c @@ -18,6 +18,7 @@ #include "AwaitEvent.h" #include <windows.h> #include "win32/AsyncIO.h" +#include "win32/ConsoleHandler.h" // Used to avoid calling abandonRequestWait() if we don't need to. // Protected by sched_mutex. @@ -34,6 +35,16 @@ awaitEvent(rtsBool wait) workerWaitingForRequests = 1; ret = awaitRequests(wait); workerWaitingForRequests = 0; + + // 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; + } + if (!ret) { return; /* still hold the lock */ } diff --git a/rts/win32/ConsoleHandler.c b/rts/win32/ConsoleHandler.c index 25472cf583..13011cbe26 100644 --- a/rts/win32/ConsoleHandler.c +++ b/rts/win32/ConsoleHandler.c @@ -240,6 +240,9 @@ static BOOL WINAPI generic_handler(DWORD dwCtrlType) stg_pending_buf[stg_pending_events] = dwCtrlType; stg_pending_events++; } + + // we need to wake up awaitEvent() + abandonRequestWait(); #endif return TRUE; } |