如果我有以下 C++ 代码(适用于 Windows 操作系统):
HANDLE hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
HANDLE hMutex = ::CreateMutex(NULL, FALSE, NULL);
HANDLE hHandles[] = {
hEvent,
hMutex
};
DWORD dwR = ::WaitForMultipleObjects(2, hHandles, FALSE, INFINITE) - WAIT_OBJECT_0;
//if dwR == 0, what state is hMutex in?
//Or, do I need to call ReleaseMutex(hMutex) in that case?
我不确定如何处理有关互斥锁的这种情况。