Task库细节修正

This commit is contained in:
MrZ626
2020-12-08 00:45:35 +08:00
parent 7d89676df6
commit fcac817f11

View File

@@ -23,7 +23,7 @@ function TASK.update()
end
function TASK.new(code,...)
local thread=ct.create(code)
if ...~=nil then ct.resume(thread,...)end
ct.resume(thread,...)
if ct.status(thread)~="dead"then
tasks[#tasks+1]={
thread=thread,
@@ -34,7 +34,7 @@ function TASK.new(code,...)
end
function TASK.newNet(code,...)
local thread=ct.create(code)
if ...~=nil then ct.resume(thread,...)end
ct.resume(thread,...)
if ct.status(thread)~="dead"then
tasks[#tasks+1]={
thread=thread,