From 39b64b57d9ada3b675d0326d53cffe314ff0cca6 Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Fri, 22 Nov 2024 10:47:12 -0500 Subject: [PATCH] SWDEV-496106 - Use lock_ops to avoid race condition in safe_stream. Change-Id: I5e98c34a41434e2f7d2e6406ea30ddcf01b1091c --- hipamd/src/hip_mempool_impl.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/hipamd/src/hip_mempool_impl.hpp b/hipamd/src/hip_mempool_impl.hpp index b38eb74d2a..1e900a111f 100644 --- a/hipamd/src/hip_mempool_impl.hpp +++ b/hipamd/src/hip_mempool_impl.hpp @@ -261,6 +261,7 @@ class MemoryPool : public amd::ReferenceCountedObject { /// Add a safe stream for quick looks-ups if event dependencies option is enabled void AddSafeStream(Stream* event_stream, Stream* wait_stream) { + amd::ScopedLock lock(lock_pool_ops_); if (EventDependencies()) { free_heap_.AddSafeStream(event_stream, wait_stream); }