Still debugging, not sure what is causing the thread to not yield properly

This commit is contained in:
2022-01-31 09:47:37 -05:00
parent 49c0bd3930
commit b572bf218d
4 changed files with 51 additions and 12 deletions
+1 -8
View File
@@ -1,9 +1,7 @@
function connectionThreadTests(multi,thread)
print("Starting Connection and Thread tests!")
print("Current Thread:",thread.getRunningThread())
func = thread:newFunction(function(count)
print("Starting Status test: ",count)
print("Current Thread:",thread.getRunningThread().thread)
local a = 0
while true do
a = a + 1
@@ -33,12 +31,7 @@ function connectionThreadTests(multi,thread)
ret.OnReturn(function()
print("Done")
end)
local err, timeout = thread.hold(ret.OnReturn + ret2.OnReturn + ret3.OnReturn,{sleep=3})
print(err,timeout)
for i,v in pairs(err) do
print(i,v)
end
os.exit()
local err, timeout = thread.hold(ret.OnReturn + ret2.OnReturn + ret3.OnReturn)
if s1 == 100 and s2 == 100 and s3 == 100 then
print("Threads: Ok")
else
+5 -1
View File
@@ -1,4 +1,6 @@
package.path="./?.lua;../?.lua;../?/init.lua;../?.lua;../?/?/init.lua;"..package.path
package.path="multi/?.lua;multi/?/init.lua;multi/?.lua;multi/?/?/init.lua;"..package.path
require("lldebugger").start()
--[[
This file runs all tests.
Format:
@@ -15,6 +17,8 @@ package.path="./?.lua;../?.lua;../?/init.lua;../?.lua;../?/?/init.lua;"..package
The expected and actual should "match" (Might be impossible when playing with threads)
This will be pushed directly to the master as tests start existing.
]]
os.execute("cd multi")
os.execute("pwd")
local multi, thread = require("multi"):init{priority=true}
local good = false
runTest = thread:newFunction(function()