summaryrefslogtreecommitdiff
path: root/rts/win32
diff options
context:
space:
mode:
authorsof@galois.com <unknown>2006-10-16 22:35:16 +0000
committersof@galois.com <unknown>2006-10-16 22:35:16 +0000
commite5d7f9c6013d1be616fa7a54e34e9ae9bac30218 (patch)
tree035f06ee7977572a4dd0858de1b8412db072a0d6 /rts/win32
parent58546748b9659f59dfdc3a917b1b64ceacc5496d (diff)
downloadhaskell-e5d7f9c6013d1be616fa7a54e34e9ae9bac30218.tar.gz
mark stop event handle as invalid once closed, making shutdowns more graceful.
Diffstat (limited to 'rts/win32')
-rw-r--r--rts/win32/Ticker.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rts/win32/Ticker.c b/rts/win32/Ticker.c
index 9fa40ebe52..7701a3b275 100644
--- a/rts/win32/Ticker.c
+++ b/rts/win32/Ticker.c
@@ -54,6 +54,7 @@ TimerProc(PVOID param)
/* event has become signalled */
tickProc = NULL;
CloseHandle(hStopEvent);
+ hStopEvent = INVALID_HANDLE_VALUE;
return 0;
case WAIT_TIMEOUT:
/* tick */
@@ -115,7 +116,10 @@ stopTicker(void)
}
if (exitCode != STILL_ACTIVE) {
tickThread = INVALID_HANDLE_VALUE;
- CloseHandle(hStopEvent);
+ if ( hStopEvent != INVALID_HANDLE_VALUE ) {
+ CloseHandle(hStopEvent);
+ hStopEvent = INVALID_HANDLE_VALUE;
+ }
return 0;
}
TerminateThread(tickThread, 0);