fix: Race removal between enqueueKernel and clFinish

Related-To: NEO-8196
Signed-off-by: Andrzej Koska <andrzej.koska@intel.com>
This commit is contained in:
Andrzej Koska
2023-10-31 12:17:31 +00:00
committed by Compute-Runtime-Automation
parent d1d4f9c9f3
commit 63aaa3b63f
4 changed files with 60 additions and 2 deletions

View File

@@ -1291,13 +1291,14 @@ WaitStatus CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *pri
}
}
TakeOwnershipWrapper<CommandQueue> queueOwnership(*this);
auto taskCountToWait = taskCount;
queueOwnership.unlock();
waitStatus = waitUntilComplete(taskCountToWait, activeBcsStates, flushStamp->peekStamp(), false, cleanTemporaryAllocationsList, waitedOnTimestamps);
{
TakeOwnershipWrapper<CommandQueue> queueOwnership(*this);
queueOwnership.lock();
/*
Check if queue resources cleanup after wait is possible.
If new submission happened during wait, we need to query completion (without waiting).