summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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