working on some bugs

This commit is contained in:
Ryan Ward 2020-03-10 12:59:31 -04:00
parent b44c46b953
commit aeb88e4bfc
2 changed files with 4 additions and 5 deletions

View File

@ -1318,7 +1318,6 @@ function multi.initThreads(justThreads)
helper(i)
end
if threads[i] and not _ then
print("TESTING",threads[i])
threads[i].OnError:Fire(threads[i],unpack(threads[i].TempRets))
threads[i].isError = true
end
@ -1334,7 +1333,7 @@ function multi.initThreads(justThreads)
end
elseif threads[i] and threads[i].task == "hold" then --GOHERE
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
if t0~=nil then
if t0 then
if t0==multi.NIL then
t0 = nil
end
@ -1348,7 +1347,7 @@ function multi.initThreads(justThreads)
end
elseif threads[i] and threads[i].task == "holdF" then
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
if t0~=nil then
if t0 then
threads[i].task = ""
threads[i].__ready = true
elseif clock() - threads[i].time>=threads[i].sec then
@ -1360,7 +1359,7 @@ function multi.initThreads(justThreads)
elseif threads[i] and threads[i].task == "holdW" then
threads[i].pos = threads[i].pos + 1
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
if t0~=nil then
if t0 then
threads[i].task = ""
threads[i].__ready = true
elseif threads[i].count==threads[i].pos then

View File

@ -3,7 +3,7 @@ multi, thread = require("multi"):init()
a=0
func = thread:newFunction(function()
return thread.holdFor(3,function()
return (a==5)
return a==5
end)
end,true) -- Tell the code to wait and then return
print(func())