summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-08-26 22:55:59 +0800
committerruki <[email protected]>2025-08-28 11:35:54 +0800
commit4c6f1c7e6c69a30af016f37ae70fd5fe49f2b3d6 (patch)
treef9eeec30ffe24cfe6293421a90d61db6cf0f316d
parent6a01597d31c28c6a55c00678ddbf9c9929a09468 (diff)
get running thread name
-rw-r--r--xmake/core/thread/thread.lua8
1 files 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 "<unknown>"
+ 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