Make ioManagerDie() idempotent
[ghc-hetmet.git] / rts / win32 / ThrIOManager.c
index 50dd4fb..35f1b5e 100644 (file)
@@ -123,6 +123,10 @@ void
 ioManagerDie (void)\r
 {\r
     sendIOManagerEvent(IO_MANAGER_DIE);\r
+    // IO_MANAGER_DIE must be idempotent, as it is called\r
+    // repeatedly by shutdownCapability().  Try conc059(threaded1) to\r
+    // illustrate the problem.\r
+    io_manager_event = INVALID_HANDLE_VALUE;\r
     // ToDo: wait for the IO manager to pick up the event, and\r
     // then release the Event and Mutex objects we've allocated.\r
 }\r