From df8d910efa3315da52de178727d00eeb6948c4bb Mon Sep 17 00:00:00 2001 From: Evgeny Date: Fri, 24 Jul 2026 16:02:49 +0300 Subject: [PATCH] =?UTF-8?q?chatgui:=20fix=20Ctrl-C=20on=20Linux=20?= =?UTF-8?q?=E2=80=94=20remove=20thread=5Flocal=20from=20g=5FcurrentNode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SIGINT on Linux can be delivered to any thread (not just worker). signal_handler uses g_currentNode->requestStop(); with thread_local, g_currentNode was nullptr in non-worker threads — Ctrl-C did nothing. Removing thread_local fixes signal delivery: g_currentNode is set once before signal handler is registered, pointer read is atomic on x86/x64. --- tools/chatgui/transport/utun_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/chatgui/transport/utun_node.cpp b/tools/chatgui/transport/utun_node.cpp index 94493577..9389262b 100644 --- a/tools/chatgui/transport/utun_node.cpp +++ b/tools/chatgui/transport/utun_node.cpp @@ -33,7 +33,7 @@ extern "C" { #define ETCP_RT_ID_CHAT 0x11 -static thread_local UtunNode* g_currentNode = nullptr; +static UtunNode* g_currentNode = nullptr; static void signal_handler(int sig) { (void)sig;