Error correction getting "unpack" function

This commit is contained in:
Dheisom Gomes 2022-01-28 12:13:52 -03:00
parent 6331a23c6b
commit 22d8f69b5c
1 changed files with 2 additions and 2 deletions

View File

@ -956,8 +956,8 @@ end
function core.add_thread(f, weak_ref, ...)
local key = weak_ref or #core.threads + 1
local args = {...}
local unpack = unpack or table.unpack
local fn = function() return core.try(f, unpack(args)) end
local table_unpack = rawget(_G, 'unpack') or rawget(_G.table, 'unpack')
local fn = function() return core.try(f, table_unpack(args)) end
core.threads[key] = { cr = coroutine.create(fn), wake = 0 }
return key
end