From 42481de5d0432f9183779fca82c506845ab10f92 Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Mon, 25 Sep 2023 09:08:47 +0000 Subject: [PATCH] refactor: limit lock scope to avoid potential deadlock Signed-off-by: Dunajski, Bartosz --- opencl/source/event/event.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/opencl/source/event/event.cpp b/opencl/source/event/event.cpp index 62a5afcae4..aab8a6143d 100644 --- a/opencl/source/event/event.cpp +++ b/opencl/source/event/event.cpp @@ -458,12 +458,14 @@ inline WaitStatus Event::wait(bool blocking, bool useQuickKmdSleep) { DEBUG_BREAK_IF(this->taskLevel == CompletionStamp::notReady && this->executionStatus >= 0); - TakeOwnershipWrapper queueOwnership(*cmdQueue); + { + TakeOwnershipWrapper 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);