From e0bc615fbf7b7461c24b4da038b14e788a3bf6e4 Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 14 Apr 2005 23:41:25 +0000 Subject: [PATCH] [project @ 2005-04-14 23:41:25 by sof] Better reporting of WAIT_FAILEDs from WaitFor*Object() calls. Merge to STABLE. --- ghc/rts/win32/AsyncIO.c | 8 ++++++-- ghc/rts/win32/Ticker.c | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ghc/rts/win32/AsyncIO.c b/ghc/rts/win32/AsyncIO.c index 257a2be..a0e03cb 100644 --- a/ghc/rts/win32/AsyncIO.c +++ b/ghc/rts/win32/AsyncIO.c @@ -77,7 +77,7 @@ onIOComplete(unsigned int reqID, issued_reqs--; if (completed_hw == 1) { /* The event is used to wake up the scheduler thread should it - * be blocked waiting for requests to complete. It reset once + * be blocked waiting for requests to complete. The event resets once * that thread has cleared out the request queue/table. */ SetEvent(completed_req_event); @@ -204,6 +204,11 @@ start: case WAIT_OBJECT_0 + 1: case WAIT_TIMEOUT: return 0; + case WAIT_FAILED: { + DWORD dw = GetLastError(); + fprintf(stderr, "awaitRequests: wait failed -- error code: %lu\n", dw); fflush(stderr); + return 0; + } default: fprintf(stderr, "awaitRequests: unexpected wait return code %lu\n", dwRes); fflush(stderr); return 0; @@ -228,7 +233,6 @@ start: * */ unsigned int rID = completedTable[i].reqID; - prev = NULL; prev = NULL; for(tso = blocked_queue_hd ; tso != END_TSO_QUEUE; prev = tso, tso = tso->link) { diff --git a/ghc/rts/win32/Ticker.c b/ghc/rts/win32/Ticker.c index 124cbc8..c1390b7 100644 --- a/ghc/rts/win32/Ticker.c +++ b/ghc/rts/win32/Ticker.c @@ -57,8 +57,13 @@ TimerProc(PVOID param) /* tick */ tickProc(0); break; + case WAIT_FAILED: { + DWORD dw = GetLastError(); + fprintf(stderr, "TimerProc: wait failed -- error code: %lu\n", dw); fflush(stderr); + break; + } default: - fprintf(stderr, "timer: unexpected result %lu\n", waitRes); fflush(stderr); + fprintf(stderr, "TimerProc: unexpected result %lu\n", waitRes); fflush(stderr); break; } } -- 1.7.10.4