SWDEV-400448 - SWDEV-392872 - Optimize to add lock only if its null stream

Change-Id: Ia905109a295614e8ce4e2bd24261c86ba8138178
Этот коммит содержится в:
Satyanvesh Dittakavi
2024-02-06 08:09:21 +00:00
родитель 24e1c34320
Коммит a6841e3f43
+5 -5
Просмотреть файл
@@ -31,11 +31,11 @@ namespace hip {
// ================================================================================================
hip::Stream* Device::NullStream(bool wait) {
{
amd::ScopedLock lock(lock_);
if (null_stream_ == nullptr) {
null_stream_ = new Stream(this, Stream::Priority::Normal, 0, true);
}
if (null_stream_ == nullptr) {
amd::ScopedLock lock(lock_);
if (null_stream_ == nullptr) {
null_stream_ = new Stream(this, Stream::Priority::Normal, 0, true);
}
}
if (null_stream_ == nullptr) {
return nullptr;