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
このコミットが含まれているのは:
German Andryeyev
2022-07-05 13:06:52 -04:00
コミット 9e74f1c7f8
+2 -1
ファイルの表示
@@ -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;
}