[idd] driver: use a timeout instead of an event wait.
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

Waiting on the events is dangerous as there is a race here where
we may end up stuck as the events need to be auto-reset
This commit is contained in:
Geoffrey McRae 2025-03-30 04:28:49 +00:00
parent b58171c3e1
commit 3b883bf9fe

View File

@ -171,21 +171,17 @@ bool CD3D12Device::HeapTest()
CD3D12CommandQueue * CD3D12Device::GetCopyQueue()
{
HANDLE waitOn[ARRAYSIZE(m_copyQueue)];
for(int c = 0; c < 100; ++c)
{
for (int i = 0; i < ARRAYSIZE(m_copyQueue); ++i)
{
auto& queue = m_copyQueue[i];
if (queue.IsReady())
return &queue;
waitOn[i] = queue.GetEvent();
}
Sleep(1);
}
DEBUG_TRACE("Wait");
DWORD ready = WaitForMultipleObjects(ARRAYSIZE(waitOn), waitOn, FALSE, INFINITE);
if (ready < ARRAYSIZE(waitOn))
return &m_copyQueue[ready];
DEBUG_ERROR("Failed to get a copy queue");
return nullptr;
}