Working on 16.0.0 #53
13
init.lua
13
init.lua
@ -1113,7 +1113,7 @@ function multi:newProcessor(name, nothread)
|
|||||||
|
|
||||||
function c:newFunction(func, holdme)
|
function c:newFunction(func, holdme)
|
||||||
return thread:newFunctionBase(function(...)
|
return thread:newFunctionBase(function(...)
|
||||||
return c:newThread("Threaded Function Handler", func, ...)
|
return c:newThread("Process Threaded Function Handler", func, ...)
|
||||||
end, holdme)()
|
end, holdme)()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1451,7 +1451,9 @@ end
|
|||||||
|
|
||||||
function thread:newFunction(func, holdme)
|
function thread:newFunction(func, holdme)
|
||||||
return thread:newFunctionBase(function(...)
|
return thread:newFunctionBase(function(...)
|
||||||
return thread:newThread("Threaded Function Handler", func, ...)
|
local th = thread:newThread("Free Threaded Function Handler", func, ...)
|
||||||
|
th.creator = debug.getinfo(2).name
|
||||||
|
return th
|
||||||
end, holdme)()
|
end, holdme)()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1485,7 +1487,7 @@ function thread:newProcessor(name)
|
|||||||
|
|
||||||
function proc:newFunction(func, holdme)
|
function proc:newFunction(func, holdme)
|
||||||
return thread:newFunctionBase(function(...)
|
return thread:newFunctionBase(function(...)
|
||||||
return thread_proc:newThread("Threaded Function Handler", func, ...)
|
return thread_proc:newThread("TProc Threaded Function Handler", func, ...)
|
||||||
end, holdme)()
|
end, holdme)()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1774,6 +1776,7 @@ co_status = {
|
|||||||
if _ then
|
if _ then
|
||||||
ref.OnDeath:Fire(ret,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16)
|
ref.OnDeath:Fire(ret,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16)
|
||||||
else
|
else
|
||||||
|
print("Thread: ", ref.Name, ref.creator, THREAD_NAME)
|
||||||
ref.OnError:Fire(ref,ret,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16)
|
ref.OnError:Fire(ref,ret,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16)
|
||||||
end
|
end
|
||||||
if i then
|
if i then
|
||||||
@ -2346,8 +2349,8 @@ end
|
|||||||
function multi.error(self, err)
|
function multi.error(self, err)
|
||||||
if type(err) == "bool" then crash = err end
|
if type(err) == "bool" then crash = err end
|
||||||
if type(self) == "string" then err = self end
|
if type(self) == "string" then err = self end
|
||||||
io.write("\x1b[91mERROR:\x1b[0m " .. err .. "\n")
|
io.write("\x1b[91mERROR:\x1b[0m " .. err .. " " .. debug.getinfo(2).name .."\n")
|
||||||
error("^^^ " .. multi:getCurrentProcess():getFullName() .. " " .. multi:getCurrentTask().Type)
|
error("^^^ " .. multi:getCurrentProcess():getFullName() .. " " .. multi:getCurrentTask().Type .. "\n" .. debug.traceback().."\n")
|
||||||
if multi.defaultSettings.error then
|
if multi.defaultSettings.error then
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -174,7 +174,7 @@ function multi:newSystemThreadedJobQueue(n)
|
|||||||
queueReturn:push{jid, funcs[name](multi.unpack(args)), queue}
|
queueReturn:push{jid, funcs[name](multi.unpack(args)), queue}
|
||||||
end).OnError(multi.error)
|
end).OnError(multi.error)
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
thread:newThread("DoAllHandler",function()
|
thread:newThread("DoAllHandler",function()
|
||||||
while true do
|
while true do
|
||||||
local dat = thread.hold(function()
|
local dat = thread.hold(function()
|
||||||
@ -190,7 +190,7 @@ function multi:newSystemThreadedJobQueue(n)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
thread:newThread("IdleHandler",function()
|
thread:newThread("IdleHandler",function()
|
||||||
while true do
|
while true do
|
||||||
thread.hold(function()
|
thread.hold(function()
|
||||||
@ -198,9 +198,9 @@ function multi:newSystemThreadedJobQueue(n)
|
|||||||
end)
|
end)
|
||||||
THREAD.sleep(.01)
|
THREAD.sleep(.01)
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
multi:mainloop()
|
multi:mainloop()
|
||||||
end,i).OnError(print)
|
end,i).OnError(multi.error)
|
||||||
end
|
end
|
||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|||||||
@ -177,7 +177,7 @@ function multi.InitSystemThreadErrorHandler()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
end
|
end
|
||||||
|
|
||||||
multi.print("Integrated Lanes Threading!")
|
multi.print("Integrated Lanes Threading!")
|
||||||
|
|||||||
@ -271,7 +271,7 @@ function multi:newSystemThreadedConnection(name)
|
|||||||
-- This shouldn't be the case
|
-- This shouldn't be the case
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ function multi:newSystemThreadedConnection(name)
|
|||||||
c.proxy_conn:Fire(multi.unpack(item[2]))
|
c.proxy_conn:Fire(multi.unpack(item[2]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
--- ^^^ This will only exist in the init thread
|
--- ^^^ This will only exist in the init thread
|
||||||
|
|
||||||
THREAD.package(name,c)
|
THREAD.package(name,c)
|
||||||
|
|||||||
@ -125,7 +125,7 @@ function multi:newProxy(list)
|
|||||||
self.recv:push(ret)
|
self.recv:push(ret)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
return self
|
return self
|
||||||
else
|
else
|
||||||
local multi, thread = require("multi"):init()
|
local multi, thread = require("multi"):init()
|
||||||
@ -300,10 +300,13 @@ function multi:newSystemThreadedProcessor(cores)
|
|||||||
return tjq:pop()
|
return tjq:pop()
|
||||||
end)
|
end)
|
||||||
if dat then
|
if dat then
|
||||||
|
for i,v in pairs(dat) do
|
||||||
|
print(i,v)
|
||||||
|
end
|
||||||
th = thread:newThread("JQ-TargetThread",function()
|
th = thread:newThread("JQ-TargetThread",function()
|
||||||
local name = table.remove(dat, 1)
|
local name = table.remove(dat, 1)
|
||||||
local jid = table.remove(dat, 1)
|
local jid = table.remove(dat, 1)
|
||||||
local func = table.remove(dat, 1)
|
local func = _G[name]
|
||||||
local args = table.remove(dat, 1)
|
local args = table.remove(dat, 1)
|
||||||
th.OnError(function(self,err)
|
th.OnError(function(self,err)
|
||||||
-- We want to pass this to the other calling thread incase
|
-- We want to pass this to the other calling thread incase
|
||||||
@ -313,7 +316,7 @@ function multi:newSystemThreadedProcessor(cores)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
c.jobqueue:registerFunction("STP_GetThreadCount",function()
|
c.jobqueue:registerFunction("STP_GetThreadCount",function()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user