From 696876f6bb8b204baf3d073b41bea21969c62423 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Thu, 10 Dec 2020 03:23:59 -0500 Subject: [PATCH] Move returned last command under the lock Change-Id: I4a2b29a6beacd56ea38d91a33b3c5f8b763be3c7 [ROCm/clr commit: 88bd851f723f03504ad32a287d252d3774707172] --- projects/clr/rocclr/platform/commandqueue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/platform/commandqueue.cpp b/projects/clr/rocclr/platform/commandqueue.cpp index 8ff9a67414..4af38dd53b 100644 --- a/projects/clr/rocclr/platform/commandqueue.cpp +++ b/projects/clr/rocclr/platform/commandqueue.cpp @@ -234,6 +234,7 @@ Command* HostQueue::getLastQueuedCommand(bool retain) { if (retain && lastEnqueueCommand_ != nullptr) { lastEnqueueCommand_->retain(); } + return lastEnqueueCommand_; } else { // Get last submitted command ScopedLock l(lastCmdLock_); @@ -243,9 +244,8 @@ Command* HostQueue::getLastQueuedCommand(bool retain) { if (retain && lastEnqueueCommand_ != nullptr) { lastEnqueueCommand_->retain(); } + return lastEnqueueCommand_; } - - return lastEnqueueCommand_; } DeviceQueue::~DeviceQueue() {