I have code like the following…
HANDLE event = CreateEvent(NULL, false, false, NULL);
// pass event to thread which will SetEvent(event);
DWORD dwResult = MsgWaitForMultipleObjectsEx(1, &event, 3 * 1000, QS_ALLEVENTS, 0);
Is it even possible for MsgWaitForMultipleObjectsEx to return WAIT_ABANDONED_0 in this scenario?
What types of objects can be “abandoned”?
It is described in the MSDN docs for WaitForSingleObject().
Only a mutex can cause this error condition. It indicates that the thread that acquired the mutex terminated without explicitly releasing it by calling ReleaseMutex(). That’s a pretty gross error condition, something is fairly majorly borked and you should hit the Big Red Emergency Stop button when this happens. It is almost never just the mutex that’s in a bad state, whatever other shared program state was touched by that thread is highly likely to be inconsistent as well.