From 135684f1212ccba20324526485a3b66d42be32ca Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 24 May 2025 13:00:32 +0800 Subject: fixup! feat: kick client (#6) added comments and explaination --- src/sessionManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp index add9015..f43bd2d 100644 --- a/src/sessionManager.cpp +++ b/src/sessionManager.cpp @@ -126,6 +126,9 @@ void CSessionManager::kick(std::pair> *s it->second.reset(); m_vSessions.erase(it); if (kill && native_handle != 0) + // cancel(terminal/kill) the thread if it doesn't exit on its own + // pthread_cancel cuz it's the safest https://stackoverflow.com/a/3438576 + // need a condition because it might crash if the thread is already dead pthread_cancel(native_handle); } } -- cgit v1.2.3