SWDEV-478065 - Embed host thread in shared_ptr

This shows up in some valgrind runs. Make sure the resources are
released.

Change-Id: I34c25c00370a221585895655744831215136d5f4
Этот коммит содержится в:
Jatin Chaudhary
2024-09-04 09:35:54 +01:00
коммит произвёл Jatin Jaikishan Chaudhary
родитель 2494992695
Коммит 4b03017e8a
+5 -3
Просмотреть файл
@@ -186,9 +186,11 @@ void Timestamp::checkGpuTime() {
bool HsaAmdSignalHandler(hsa_signal_value_t value, void* arg) {
Timestamp* ts = reinterpret_cast<Timestamp*>(arg);
amd::Thread* thread = amd::Thread::current();
if (!(thread != nullptr ||
((thread = new amd::HostThread()) != nullptr && thread == amd::Thread::current()))) {
static std::shared_ptr<amd::Thread> thread;
if (amd::Thread::current() == nullptr) {
thread = std::make_shared<amd::HostThread>();
}
if (thread.get() != amd::Thread::current()) {
return false;
}