mirror of
https://github.com/rayaman/multi.git
synced 2026-09-05 07:27:35 -04:00
newProxy and STP work
This commit is contained in:
@@ -134,7 +134,7 @@ function multi:newSystemThreadedJobQueue(n)
|
||||
end)
|
||||
return thread.hold(function()
|
||||
if rets then
|
||||
return unpack(rets) or multi.NIL
|
||||
return multi.unpack(rets) or multi.NIL
|
||||
end
|
||||
end)
|
||||
end,holup),name
|
||||
@@ -144,7 +144,7 @@ function multi:newSystemThreadedJobQueue(n)
|
||||
thread.yield()
|
||||
local dat = c.queueReturn:pop()
|
||||
if dat then
|
||||
c.OnJobCompleted:Fire(unpack(dat))
|
||||
c.OnJobCompleted:Fire(multi.unpack(dat))
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -188,7 +188,7 @@ function multi:newSystemThreadedJobQueue(n)
|
||||
lastProc = os.clock()
|
||||
local name = table.remove(dat,1)
|
||||
local id = table.remove(dat,1)
|
||||
local tab = {funcs[name](unpack(dat))}
|
||||
local tab = {funcs[name](multi.unpack(dat))}
|
||||
table.insert(tab,1,id)
|
||||
queueReturn:push(tab)
|
||||
end)
|
||||
@@ -264,7 +264,7 @@ function multi:newSystemThreadedConnection(name)
|
||||
end
|
||||
link_self_ref:pop()
|
||||
elseif item[1] == self.TRIG then
|
||||
self.proxy_conn:Fire(unpack(item[2]))
|
||||
self.proxy_conn:Fire(multi.unpack(item[2]))
|
||||
link_self_ref:pop()
|
||||
else
|
||||
-- This shouldn't be the case
|
||||
@@ -341,8 +341,8 @@ function multi:newSystemThreadedConnection(name)
|
||||
c.links[#c.links+1] = item[2]
|
||||
|
||||
elseif item[1] == c.TRIG then
|
||||
fire(unpack(item[2]))
|
||||
c.proxy_conn:Fire(unpack(item[2]))
|
||||
fire(multi.unpack(item[2]))
|
||||
c.proxy_conn:Fire(multi.unpack(item[2]))
|
||||
end
|
||||
end
|
||||
end).OnError(print)
|
||||
|
||||
@@ -54,7 +54,7 @@ multi.integration.GLOBAL = GLOBAL
|
||||
multi.integration.THREAD = THREAD
|
||||
pcall(require,"multi.integration.loveManager.extensions")
|
||||
pcall(require,"multi.integration.sharedExtensions")
|
||||
stab["returns"] = {THREAD.loadDump(__FUNC__)(unpack(__IMPORTS))}
|
||||
stab["returns"] = {THREAD.loadDump(__FUNC__)(multi.unpack(__IMPORTS))}
|
||||
]]
|
||||
|
||||
local multi, thread = require("multi"):init()
|
||||
@@ -86,7 +86,7 @@ function multi:newSystemThread(name, func, ...)
|
||||
thread.hold(function()
|
||||
-- While the thread is running we might as well do something in the loop
|
||||
if status_channel:peek() ~= nil then
|
||||
c.statusconnector:Fire(unpack(status_channel:pop()))
|
||||
c.statusconnector:Fire(multi.unpack(status_channel:pop()))
|
||||
end
|
||||
return not c.thread:isRunning()
|
||||
end)
|
||||
@@ -100,7 +100,7 @@ function multi:newSystemThread(name, func, ...)
|
||||
elseif thread_err then
|
||||
c.OnError:Fire(c, thread_err)
|
||||
elseif c.stab.returns then
|
||||
c.OnDeath:Fire(unpack(c.stab.returns))
|
||||
c.OnDeath:Fire(multi.unpack(c.stab.returns))
|
||||
c.stab.returns = nil
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -223,7 +223,7 @@ if not ISTHREAD then
|
||||
multi:newLoop(function(loop)
|
||||
dat = queue:pop()
|
||||
if dat then
|
||||
print(unpack(dat))
|
||||
print(multi.unpack(dat))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user