SWDEV-311271 - Make sure memory pool can accept default stream

Add lock protection for access to the pool list.
Remove destroyed stream from the list of the safe streams

Change-Id: I1863b89bd3f5e188c161227cc790c3adaf72cc58
This commit is contained in:
German Andryeyev
2022-04-14 19:04:01 -04:00
orang tua b06ee8834d
melakukan 5957ff9f7b
6 mengubah file dengan 63 tambahan dan 8 penghapusan
+2
Melihat File
@@ -436,6 +436,8 @@ hipError_t hipStreamDestroy(hipStream_t stream) {
}
hip::Stream* s = reinterpret_cast<hip::Stream*>(stream);
s->GetDevice()->RemoveStreamFromPools(s);
amd::ScopedLock lock(g_captureStreamsLock);
const auto& g_it = std::find(g_captureStreams.begin(), g_captureStreams.end(), s);
if (g_it != g_captureStreams.end()) {