From: sof Date: Fri, 22 Apr 2005 17:50:13 +0000 (+0000) Subject: [project @ 2005-04-22 17:50:13 by sof] X-Git-Tag: Initial_conversion_from_CVS_complete~693 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fbf16357622e4bf6ec5f00383dd167d5e7dbc9e1;p=ghc-hetmet.git [project @ 2005-04-22 17:50:13 by sof] Switch to a manual-reset event for the completed-console-event object; with auto-reset, we ran the risk of leaving it in a signalled state. Merge to STABLE. --- diff --git a/ghc/rts/win32/ConsoleHandler.c b/ghc/rts/win32/ConsoleHandler.c index c68dc1d..4e470b3 100644 --- a/ghc/rts/win32/ConsoleHandler.c +++ b/ghc/rts/win32/ConsoleHandler.c @@ -38,7 +38,7 @@ initUserSignals(void) if (hConsoleEvent == INVALID_HANDLE_VALUE) { hConsoleEvent = CreateEvent ( NULL, /* default security attributes */ - FALSE, /* auto-reset event */ + TRUE, /* manual-reset event */ FALSE, /* initially non-signalled */ NULL); /* no name */ } @@ -291,7 +291,9 @@ rts_ConsoleHandlerDone(int ev) if ( (DWORD)ev == CTRL_BREAK_EVENT || (DWORD)ev == CTRL_C_EVENT ) { /* only these two cause stdin system calls to abort.. */ - SetEvent(hConsoleEvent); /* event is auto-reset */ + SetEvent(hConsoleEvent); /* event is manual-reset */ + Sleep(0); /* yield */ + ResetEvent(hConsoleEvent); /* turn it back off again */ } }