From 4c6f1c7e6c69a30af016f37ae70fd5fe49f2b3d6 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 26 Aug 2025 22:55:59 +0800 Subject: get running thread name --- xmake/core/thread/thread.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xmake/core/thread/thread.lua b/xmake/core/thread/thread.lua index a7f82fe29..bdf1c0380 100644 --- a/xmake/core/thread/thread.lua +++ b/xmake/core/thread/thread.lua @@ -197,10 +197,9 @@ function thread.new(callback, opt) return _instance.new(callback, opt) end --- get the running thread +-- get the running thread name function thread.running() - -- TODO - return "" + return thread._RUNNING end -- run thread @@ -253,6 +252,9 @@ function thread._run_thread(callback_str, callinfo_str) return false, errors end + -- save the running thread name + thread._RUNNING = threadname + -- do callback return sandbox.load(sandbox_inst:script(), table.unpack(argv or {})) end -- cgit v1.3.1