From 3f3f3d0f1c01b6ac592dc2bf5c69cf60e18095cf Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Tue, 19 Nov 2024 05:02:21 +0000 Subject: [PATCH] SWDEV-498816 - Detached thread might exit and pthread_t is invalid access to check if it is valid or not. Hence, It is not required to check it if thread is already finished processing packets. Change-Id: If1b43a169a06203f3e1ab0529cf592879496d7c4 --- rocclr/device/devhostcall.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocclr/device/devhostcall.cpp b/rocclr/device/devhostcall.cpp index d59e4f799b..4a5bfb235b 100644 --- a/rocclr/device/devhostcall.cpp +++ b/rocclr/device/devhostcall.cpp @@ -334,7 +334,7 @@ void HostcallListener::consumePackets() { } void HostcallListener::terminate() { - if (!amd::Os::isThreadAlive(thread_)) { + if (thread_.state() < Thread::FINISHED && !amd::Os::isThreadAlive(thread_)) { return; } kHostThreadActive.state = Init::State::kExit;