SWDEV-372757 - Don't destroy null queue in MT

Skip destruction of the null queue for MT. Windows can destroy worker
thread on exit during the stream destruction, causing a race condition.

Change-Id: I3e4bc3ab2b477d38c0aec1fc59e6f1af0f8f6b0f


[ROCm/clr commit: f39655c0c8]
This commit is contained in:
German
2023-01-06 15:18:26 -05:00
committed by Maneesh Gupta
parent 149afa9444
commit 3afbe3a155
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -48,8 +48,12 @@ Stream::~Stream() {
amd::ScopedLock lock(streamSetLock);
streamSet.erase(this);
queue_->release();
queue_ = nullptr;
// Skip queue destruction for null stream in MT. Queue worker thread can be destroyed on
// the app exit, during the stream destruction, causing a race condition.
if (!null_ || AMD_DIRECT_DISPATCH) {
queue_->release();
queue_ = nullptr;
}
}
}