[project @ 2005-04-14 23:41:25 by sof]
authorsof <unknown>
Thu, 14 Apr 2005 23:41:25 +0000 (23:41 +0000)
committersof <unknown>
Thu, 14 Apr 2005 23:41:25 +0000 (23:41 +0000)
Better reporting of WAIT_FAILEDs from WaitFor*Object() calls.

Merge to STABLE.

ghc/rts/win32/AsyncIO.c
ghc/rts/win32/Ticker.c

index 257a2be..a0e03cb 100644 (file)
@@ -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) {
index 124cbc8..c1390b7 100644 (file)
@@ -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;
     }
   }