mirror of
https://github.com/rayaman/multi.git
synced 2026-09-04 23:17:35 -04:00
Still debugging, not sure what is causing the thread to not yield properly
This commit is contained in:
@@ -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
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user