I have an event loop waiting for several auto-reset events. All events were initialized to the eventHandles_
array using CreateEvent(NULL, false, false, NULL)
.
while (true) { DWORD waitResult = WaitForMultipleObjects(3, eventHandles_, false, INFINITE); switch (waitResult) { case WAIT_OBJECT_0 + 0: //handle event... case WAIT_OBJECT_0 + 1: //handle event... case WAIT_OBJECT_0 + 2: //handle event... } }
My question is: if events 1 and 2 happen simultaneously, the loop will process WAIT_OBJECT_0 + 1
, because it is the first. But will event 2 remain a signal when the loop reappears? Or does it automatically get reset?
source share