V15.2.0 #33

Merged
rayaman merged 75 commits from v15.2.0 into master 2022-04-19 18:45:52 -04:00
2 changed files with 30 additions and 12 deletions
Showing only changes of commit 3f046afaa1 - Show all commits

View File

@ -925,18 +925,16 @@ function multi:newProcessor(name,nothread)
sandcount = sandcount + 1 sandcount = sandcount + 1
c.Mainloop = {} c.Mainloop = {}
c.Type = "process" c.Type = "process"
c.Active = false or nothread local Active = nothread or false
c.Name = name or "" c.Name = name or ""
c.pump = false c.pump = false
c.threads = {} c.threads = {}
c.startme = {} c.startme = {}
local handler = c:createHandler(c.threads,c.startme) local handler = c:createHandler(c.threads,c.startme)
c.process = multi:newLoop(function() c.process = multi:newLoop(function()
if c.Active then if Active then
c.pump = true
c:uManager() c:uManager()
handler() handler()
c.pump = false
end end
end) end)
c.process.isProcessThread = true c.process.isProcessThread = true
@ -954,23 +952,28 @@ function multi:newProcessor(name,nothread)
end,holdme)() end,holdme)()
end end
function c.run() function c.run()
if not Active then return end
c.pump = true c.pump = true
c:uManager() c:uManager()
handler() handler()
c.pump = false c.pump = false
return c
end
function c.isActive()
return Active
end end
function c.Start() function c.Start()
if nothread then return self end print("Proc Start",mainloopActive)
c.Active = true Active = true
return self return c
end end
function c.Stop() function c.Stop()
if nothread then return self end print("Proc Stop")
c.Active = false Active = false
return self return c
end end
function c:Destroy() function c:Destroy()
c.Active = false Active = false
c.process:Destroy() c.process:Destroy()
end end
return c return c
@ -1514,6 +1517,7 @@ local handler = coroutine.wrap(function(self)
end end
yield() yield()
end end
yield()
end end
end) end)
@ -1536,6 +1540,7 @@ function multi:createHandler(threads,startme)
end end
yield() yield()
end end
yield()
end end
end) end)
end end

View File

@ -15,6 +15,17 @@ proc = multi:newProcessor("Test")
proc.Start() proc.Start()
multi:newTLoop(function()
end,1)
-- thread:newThread(function()
-- while true do
-- thread.sleep(1)
-- print("Proc: ".. tostring(proc.isActive()))
-- end
-- end)
local func = proc:newFunction(function(a,b,c) local func = proc:newFunction(function(a,b,c)
print("Testing proc functions!",a,b,c) print("Testing proc functions!",a,b,c)
for i=1,10 do for i=1,10 do
@ -31,6 +42,8 @@ thread:newThread(function()
proc.Start() proc.Start()
end) end)
func("Some","tests","needed")
func("Some","tests","needed").connect(print)
multi:mainloop() multi:mainloop()