call ShutdownIOManager() before closing handles
authorSimon Marlow <simonmar@microsoft.com>
Wed, 30 Aug 2006 12:31:31 +0000 (12:31 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 30 Aug 2006 12:31:31 +0000 (12:31 +0000)
To avoid IO requests completing only to discover that the
completed_table_sema has been CloseHandle()'d.  This all looks a bit
wrong, though: we shouldn't really be waiting for these requests to
complete, they might take forever.

rts/win32/AsyncIO.c

index 3f99113..d471ee8 100644 (file)
@@ -173,6 +173,7 @@ startupAsyncIO()
 void
 shutdownAsyncIO()
 {
+    ShutdownIOManager();
     if (completed_req_event != INVALID_HANDLE_VALUE) {
         CloseHandle(completed_req_event);
        completed_req_event = INVALID_HANDLE_VALUE;
@@ -185,7 +186,6 @@ shutdownAsyncIO()
         CloseHandle(completed_table_sema);
        completed_table_sema = NULL;
     }
-    ShutdownIOManager();
 }
 
 /*