SWDEV-329789 - Avoid a race condition with the last command

Runtime can reset the last command only if it didn't change
since the query at the beginning of finish()

Change-Id: I629f2d788e9bbaa17ca4e96b1a753f8131e32463


[ROCm/clr commit: 9e74f1c7f8]
这个提交包含在:
German Andryeyev
2022-07-05 13:06:52 -04:00
父节点 dd6af4295c
当前提交 685104cefc
@@ -136,7 +136,8 @@ void HostQueue::finish() {
if (IS_HIP) {
ScopedLock sl(vdev()->execution());
ScopedLock l(lastCmdLock_);
if (lastEnqueueCommand_ != nullptr) {
// Runtime can clear the last command only if no other submissions occured during finish()
if (command == lastEnqueueCommand_) {
lastEnqueueCommand_->release();
lastEnqueueCommand_ = nullptr;
}