我有一个事件对象向量,它在WaitForMultipleObjects
函数中使用。发出事件信号后,我尝试使用关闭句柄函数关闭事件,但出现类似Invalid handle was specified
. 谁能告诉那是什么问题?
std::vector<HANDLE> eventVector;
//..
// Entering data to vector
size_t count = eventVector.size();
DWORD signaledEvent;
While(count > 0)
{
if (WAIT_OBJECT_0 == (signaledEvent = WaitForMultipleObjects(handleVector.size(),handleVector.data(), false, INFINITE)))
CloseHandle(handleVector[signaledEvent - WAIT_OBJECT_0]); // Here I am getting error.
count--;
}