Move returned last command under the lock

Change-Id: I4a2b29a6beacd56ea38d91a33b3c5f8b763be3c7


[ROCm/clr commit: 88bd851f72]
此提交包含在:
German Andryeyev
2020-12-10 03:23:59 -05:00
父節點 5bb213cc2b
當前提交 696876f6bb
+2 -2
查看文件
@@ -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() {