diff options
| author | ruki <[email protected]> | 2025-04-28 21:04:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-08-28 11:35:53 +0800 |
| commit | c144ca1a86c559af204f0b51c4cf2b2c5afe0d41 (patch) | |
| tree | 5ee252819508ce01476fbfc3b50a80c32ef74fd3 /xmake/core/thread/thread.lua | |
| parent | 568e22b7879e47616ba96e35a750cf950321742c (diff) | |
improve sleep tests
Diffstat (limited to 'xmake/core/thread/thread.lua')
| -rw-r--r-- | xmake/core/thread/thread.lua | 10 |
1 files changed, 6 insertions, 4 deletions
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 "<unknown>" 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 |
