SWDEV-400448 - SWDEV-392872 - Optimize to add lock only if its null stream
Change-Id: Ia905109a295614e8ce4e2bd24261c86ba8138178
[ROCm/clr commit: a6841e3f43]
This commit is contained in:
@@ -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;
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user