Working on 16.0.0 #53

Merged
rayaman merged 120 commits from v16.0.0 into master 2024-02-25 00:00:51 -05:00
2 changed files with 31 additions and 23 deletions
Showing only changes of commit 5359be0772 - Show all commits

View File

@ -52,6 +52,9 @@ function multi:newProxy(list)
c.is_init = false
local multi, thread = nil, nil
function c:init()
for i,v in pairs(self) do
print("Pattern",i,v)
end
local multi, thread = nil, nil
local function copy(obj)
if type(obj) ~= 'table' then return obj end
@ -169,6 +172,7 @@ function multi:newProxy(list)
return self
end
end
function c:getTransferable()
local cp = {}
local multi, thread = require("multi"):init()
@ -193,8 +197,12 @@ function multi:newProxy(list)
proxy.funcs = self.funcs
return proxy:init()
end
for i,v in pairs(cp) do
print("TRANS", i, v)
end
return cp
end
self:create(c)
return c
end

View File

@ -195,25 +195,25 @@ multi:newThread("Scheduler Thread",function()
local tloop = stp:newTLoop(nil, 1)
multi:newSystemThread("Testing proxy copy THREAD",function(tloop)
local multi, thread = require("multi"):init()
for i,v in pairs(tloop.funcs) do
print(i,v)
end
tloop = tloop:init()
multi.print("tloop type:",tloop.Type)
multi.print("Testing proxies on other threads")
thread:newThread(function()
while true do
thread.hold(tloop.OnLoop)
print(THREAD_NAME,"Loopy")
end
end)
tloop.OnLoop(function(a)
print(THREAD_NAME, "Got loop...")
end)
multi:mainloop()
end, tloop:getTransferable()).OnError(multi.error)
-- multi:newSystemThread("Testing proxy copy THREAD",function(tloop)
-- local multi, thread = require("multi"):init()
-- for i,v in pairs(tloop.funcs) do
-- print(i,v)
-- end
-- tloop = tloop:init()
-- multi.print("tloop type:",tloop.Type)
-- multi.print("Testing proxies on other threads")
-- thread:newThread(function()
-- while true do
-- thread.hold(tloop.OnLoop)
-- print(THREAD_NAME,"Loopy")
-- end
-- end)
-- tloop.OnLoop(function(a)
-- print(THREAD_NAME, "Got loop...")
-- end)
-- multi:mainloop()
-- end, tloop:getTransferable()).OnError(multi.error)
multi.print("tloop", tloop.Type)
multi.print("tloop.OnLoop", tloop.OnLoop.Type)
@ -225,8 +225,8 @@ multi:newThread("Scheduler Thread",function()
thread.hold(tloop.OnLoop)
multi.print("Held on proxy connection... twice")
proxy_test = true
end).OnError(print)
print(6)
end).OnError(multi.error)
thread:newThread(function()
while true do
@ -240,8 +240,8 @@ multi:newThread("Scheduler Thread",function()
end)
t, val = thread.hold(function()
return count == 10
end,{sleep=5})
return proxy_test
end,{sleep=15})
if val == multi.TIMEOUT then
multi.error("SystemThreadedProcessor/Proxies: Failed")