From 375ed9d848aa050a49baca1958a44692cbe15537 Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Wed, 2 Oct 2024 13:42:39 -0400 Subject: [PATCH] SWDEV-478065 - Revert "SWDEV-478065 - Embed host thread in shared_ptr" This reverts commit 274fd2628f3b872da25b7e1fe49f01ea09b3900f. Reason for revert: This blocks multithreaded callbacks Change-Id: I9944417e4fb63c9eea2b286c828c7dfa621c4fe8 [ROCm/clr commit: d3d0ca5fc6f94b87446816bd35dfdb8e8ec16a1b] --- projects/clr/rocclr/device/rocm/rocvirtual.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/projects/clr/rocclr/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/device/rocm/rocvirtual.cpp index c173d60dd0..dfea660d1c 100644 --- a/projects/clr/rocclr/device/rocm/rocvirtual.cpp +++ b/projects/clr/rocclr/device/rocm/rocvirtual.cpp @@ -186,11 +186,9 @@ void Timestamp::checkGpuTime() { bool HsaAmdSignalHandler(hsa_signal_value_t value, void* arg) { Timestamp* ts = reinterpret_cast(arg); - static std::shared_ptr thread; - if (amd::Thread::current() == nullptr) { - thread = std::make_shared(); - } - if (thread.get() != amd::Thread::current()) { + amd::Thread* thread = amd::Thread::current(); + if (!(thread != nullptr || + ((thread = new amd::HostThread()) != nullptr && thread == amd::Thread::current()))) { return false; }