SWDEV-400448 - SWDEV-392872 - Add lock to NullStream
Fetching null stream's logic has changed earlier from amd::HostQueue to hip::Stream. This seem to cause some timing difference between checking for null stream and creating it due to which issues are observed in multithreaded applications using default stream. Change-Id: Ie02365dec537275d23a1d225de9811e2fd3a9c55
Этот коммит содержится в:
@@ -31,10 +31,12 @@ namespace hip {
|
||||
|
||||
// ================================================================================================
|
||||
hip::Stream* Device::NullStream(bool wait) {
|
||||
if (null_stream_ == nullptr) {
|
||||
null_stream_ = new Stream(this, Stream::Priority::Normal, 0, true);
|
||||
{
|
||||
amd::ScopedLock lock(lock_);
|
||||
if (null_stream_ == nullptr) {
|
||||
null_stream_ = new Stream(this, Stream::Priority::Normal, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (null_stream_ == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user