refactor: limit lock scope to avoid potential deadlock

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz 2023-09-25 09:08:47 +00:00 committed by Compute-Runtime-Automation
parent 0f161c1f19
commit 42481de5d0
1 changed files with 6 additions and 4 deletions

View File

@ -458,12 +458,14 @@ inline WaitStatus Event::wait(bool blocking, bool useQuickKmdSleep) {
DEBUG_BREAK_IF(this->taskLevel == CompletionStamp::notReady && this->executionStatus >= 0);
TakeOwnershipWrapper<CommandQueue> queueOwnership(*cmdQueue);
{
TakeOwnershipWrapper<CommandQueue> queueOwnership(*cmdQueue);
bool checkQueueCompletionForPostSyncOperations = !(waitedOnTimestamps && !cmdQueue->isOOQEnabled() &&
(this->timestampPacketContainer->peekNodes() == cmdQueue->getTimestampPacketContainer()->peekNodes()));
bool checkQueueCompletionForPostSyncOperations = !(waitedOnTimestamps && !cmdQueue->isOOQEnabled() &&
(this->timestampPacketContainer->peekNodes() == cmdQueue->getTimestampPacketContainer()->peekNodes()));
cmdQueue->handlePostCompletionOperations(checkQueueCompletionForPostSyncOperations);
cmdQueue->handlePostCompletionOperations(checkQueueCompletionForPostSyncOperations);
}
auto *allocationStorage = cmdQueue->getGpgpuCommandStreamReceiver().getInternalAllocationStorage();
allocationStorage->cleanAllocationList(this->taskCount, TEMPORARY_ALLOCATION);