From fbf16357622e4bf6ec5f00383dd167d5e7dbc9e1 Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 22 Apr 2005 17:50:13 +0000 Subject: [PATCH] [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. --- ghc/rts/win32/ConsoleHandler.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 */ } } -- 1.7.10.4