From c144ca1a86c559af204f0b51c4cf2b2c5afe0d41 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 28 Apr 2025 21:04:42 +0800 Subject: improve sleep tests --- xmake/core/thread/thread.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xmake/core/thread/thread.lua') diff --git a/xmake/core/thread/thread.lua b/xmake/core/thread/thread.lua index 19546c878..612af4865 100644 --- a/xmake/core/thread/thread.lua +++ b/xmake/core/thread/thread.lua @@ -202,6 +202,7 @@ end -- get the running thread function thread.running() -- TODO + return "" end -- run thread @@ -217,7 +218,7 @@ function thread._run_thread(callinfo_str) callback_str = parts[1] end - -- load callback + -- load callback, TODO print thread name local callback local fenvs = {} if callback_str then @@ -225,14 +226,15 @@ function thread._run_thread(callinfo_str) if not script then return false, string.format("cannot load thread callback, %s!", errors or "unknown") end - --[[ for i = 1, math.huge do local upname, upvalue = debug.getupvalue(script, i) if upname == nil or upname == "" then break end - print("upname", i, upname, upvalue) - end]] + if upvalue == nil then + return false, string.format("we cannot access upvalue(%s) in thread callback!", upname) + end + end callback = script end if not callback then -- cgit v1.3.1