V15.3.0 #46
@ -1137,7 +1137,6 @@ end
|
|||||||
|
|
||||||
function thread.pushStatus(...)
|
function thread.pushStatus(...)
|
||||||
local t = thread.getRunningThread()
|
local t = thread.getRunningThread()
|
||||||
print("Pushing",t)
|
|
||||||
t.statusconnector:Fire(...)
|
t.statusconnector:Fire(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1433,6 +1432,7 @@ function multi:attachScheduler()
|
|||||||
local cmds = {-- ipart: t_hold, t_sleep, t_holdF, t_skip, t_holdW, t_yield, t_none <-- Order
|
local cmds = {-- ipart: t_hold, t_sleep, t_holdF, t_skip, t_holdW, t_yield, t_none <-- Order
|
||||||
function(th,arg1,arg2,arg3)
|
function(th,arg1,arg2,arg3)
|
||||||
--print("hold",arg1,arg2,arg3)
|
--print("hold",arg1,arg2,arg3)
|
||||||
|
--print(_,ret,r1,r2,r3,r4,r5)
|
||||||
th.func = arg1
|
th.func = arg1
|
||||||
th.task = t_hold
|
th.task = t_hold
|
||||||
th.interval = arg3 or 0
|
th.interval = arg3 or 0
|
||||||
@ -1478,8 +1478,8 @@ function multi:attachScheduler()
|
|||||||
cmds[r1](ref,r2,r3,r4,r5)
|
cmds[r1](ref,r2,r3,r4,r5)
|
||||||
r1=nil r2=nil r3=nil r4=nil r5=nil
|
r1=nil r2=nil r3=nil r4=nil r5=nil
|
||||||
end,
|
end,
|
||||||
["normal"] = function(thd,ref) end, -- Not sure if I will handle this
|
["normal"] = function(thd,ref) print("Normal Status") io.read() end, -- Not sure if I will handle this
|
||||||
["running"] = function(thd,ref) end,
|
["running"] = function(thd,ref) print("Running Status") io.read() end,
|
||||||
["dead"] = function(thd,ref,task,i)
|
["dead"] = function(thd,ref,task,i)
|
||||||
if _ then
|
if _ then
|
||||||
print("Death")
|
print("Death")
|
||||||
|
|||||||
42
rockspecs/multi-15.2-0.rockspec
Normal file
42
rockspecs/multi-15.2-0.rockspec
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package = "multi"
|
||||||
|
version = "15.2-0"
|
||||||
|
source = {
|
||||||
|
url = "git://github.com/rayaman/multi.git",
|
||||||
|
tag = "v15.2.0",
|
||||||
|
}
|
||||||
|
description = {
|
||||||
|
summary = "Lua Multi tasking library",
|
||||||
|
detailed = [[
|
||||||
|
This library contains many methods for multi tasking. Features non coroutine based multi-tasking, coroutine based multi-tasking, and system threading (Requires use of an integration).
|
||||||
|
Check github for documentation.
|
||||||
|
]],
|
||||||
|
homepage = "https://github.com/rayaman/multi",
|
||||||
|
license = "MIT"
|
||||||
|
}
|
||||||
|
dependencies = {
|
||||||
|
"lua >= 5.1",
|
||||||
|
"lanes",
|
||||||
|
}
|
||||||
|
build = {
|
||||||
|
type = "builtin",
|
||||||
|
modules = {
|
||||||
|
["multi"] = "multi/init.lua",
|
||||||
|
["multi.compat.love2d"] = "multi/compat/love2d.lua",
|
||||||
|
["multi.compat.lovr"] = "multi/compat/lovr.lua",
|
||||||
|
["multi.integration.lanesManager"] = "multi/integration/lanesManager/init.lua",
|
||||||
|
["multi.integration.lanesManager.extensions"] = "multi/integration/lanesManager/extensions.lua",
|
||||||
|
["multi.integration.lanesManager.threads"] = "multi/integration/lanesManager/threads.lua",
|
||||||
|
["multi.integration.loveManager"] = "multi/integration/loveManager/init.lua",
|
||||||
|
["multi.integration.loveManager.extensions"] = "multi/integration/loveManager/extensions.lua",
|
||||||
|
["multi.integration.loveManager.threads"] = "multi/integration/loveManager/threads.lua",
|
||||||
|
--["multi.integration.lovrManager"] = "multi/integration/lovrManager/init.lua",
|
||||||
|
--["multi.integration.lovrManager.extensions"] = "multi/integration/lovrManager/extensions.lua",
|
||||||
|
--["multi.integration.lovrManager.threads"] = "multi/integration/lovrManager/threads.lua",
|
||||||
|
["multi.integration.pesudoManager"] = "multi/integration/pesudoManager/init.lua",
|
||||||
|
["multi.integration.pesudoManager.extensions"] = "multi/integration/pesudoManager/extensions.lua",
|
||||||
|
["multi.integration.pesudoManager.threads"] = "multi/integration/pesudoManager/threads.lua",
|
||||||
|
["multi.integration.luvitManager"] = "multi/integration/luvitManager.lua",
|
||||||
|
["multi.integration.threading"] = "multi/integration/threading.lua",
|
||||||
|
--["multi.integration.networkManager"] = "multi/integration/networkManager.lua",
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,7 @@
|
|||||||
function connectionThreadTests(multi,thread)
|
function connectionThreadTests(multi,thread)
|
||||||
print("Starting Connection and Thread tests!")
|
print("Starting Connection and Thread tests!")
|
||||||
print("Current Thread:",thread.getRunningThread())
|
|
||||||
func = thread:newFunction(function(count)
|
func = thread:newFunction(function(count)
|
||||||
print("Starting Status test: ",count)
|
print("Starting Status test: ",count)
|
||||||
print("Current Thread:",thread.getRunningThread().thread)
|
|
||||||
local a = 0
|
local a = 0
|
||||||
while true do
|
while true do
|
||||||
a = a + 1
|
a = a + 1
|
||||||
@ -33,12 +31,7 @@ function connectionThreadTests(multi,thread)
|
|||||||
ret.OnReturn(function()
|
ret.OnReturn(function()
|
||||||
print("Done")
|
print("Done")
|
||||||
end)
|
end)
|
||||||
local err, timeout = thread.hold(ret.OnReturn + ret2.OnReturn + ret3.OnReturn,{sleep=3})
|
local err, timeout = thread.hold(ret.OnReturn + ret2.OnReturn + ret3.OnReturn)
|
||||||
print(err,timeout)
|
|
||||||
for i,v in pairs(err) do
|
|
||||||
print(i,v)
|
|
||||||
end
|
|
||||||
os.exit()
|
|
||||||
if s1 == 100 and s2 == 100 and s3 == 100 then
|
if s1 == 100 and s2 == 100 and s3 == 100 then
|
||||||
print("Threads: Ok")
|
print("Threads: Ok")
|
||||||
else
|
else
|
||||||
|
|||||||
@ -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.
|
This file runs all tests.
|
||||||
Format:
|
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)
|
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.
|
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 multi, thread = require("multi"):init{priority=true}
|
||||||
local good = false
|
local good = false
|
||||||
runTest = thread:newFunction(function()
|
runTest = thread:newFunction(function()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user