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 */
}
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 */
}
}