From aeb88e4bfc85a2f88e20d8e9a59cb1b912f198e7 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Tue, 10 Mar 2020 12:59:31 -0400 Subject: [PATCH] working on some bugs --- multi/init.lua | 7 +++---- test.lua | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/multi/init.lua b/multi/init.lua index 95a08f3..471004a 100644 --- a/multi/init.lua +++ b/multi/init.lua @@ -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 diff --git a/test.lua b/test.lua index 3fb24a0..af63d80 100644 --- a/test.lua +++ b/test.lua @@ -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())