fix up Win32 build
authorSimon Marlow <simonmar@microsoft.com>
Thu, 16 Mar 2006 14:48:56 +0000 (14:48 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 16 Mar 2006 14:48:56 +0000 (14:48 +0000)
ghc/rts/win32/AsyncIO.c
ghc/rts/win32/ConsoleHandler.c

index b8cbf28..7bcf571 100644 (file)
@@ -219,7 +219,7 @@ start:
     if (completed_hw == 0) {
        /* empty table, drop lock and wait */
        LeaveCriticalSection(&queue_lock);
-       if ( wait && !interrupted ) {
+       if ( wait && sched_state == SCHED_RUNNING ) {
            DWORD dwRes = WaitForMultipleObjects(2, wait_handles, FALSE, INFINITE);
            switch (dwRes) {
            case WAIT_OBJECT_0:
index 0a45e12..413e13c 100644 (file)
@@ -70,7 +70,7 @@ static BOOL WINAPI shutdown_handler(DWORD dwCtrlType)
        // If we're already trying to interrupt the RTS, terminate with
        // extreme prejudice.  So the first ^C tries to exit the program
        // cleanly, and the second one just kills it.
-       if (interrupted) {
+       if (sched_state >= SCHED_INTERRUPTING) {
            stg_exit(EXIT_INTERRUPTED);
        } else {
            interruptStgRts();