Fixed some bugs

This commit is contained in:
2023-05-30 23:50:36 -04:00
parent 03ecb47f6f
commit d520e0a93a
6 changed files with 32 additions and 33 deletions
+2 -2
View File
@@ -167,12 +167,12 @@ function multi:newSystemThreadedJobQueue(n)
return queueJob:pop()
end)
idle = clock()
thread:newThread("test",function()
thread:newThread("JobQueue-Spawn",function()
local name = table.remove(dat, 1)
local jid = table.remove(dat, 1)
local args = table.remove(dat, 1)
queueReturn:push{jid, funcs[name](multi.unpack(args)), queue}
end)
end).OnError(multi.error)
end
end).OnError(print)
thread:newThread("DoAllHandler",function()
+1 -1
View File
@@ -132,7 +132,7 @@ function multi.InitSystemThreadErrorHandler()
thread.yield()
_,data = __ConsoleLinda:receive(0, "Q")
if data then
print(data[1])
--print(data[1])
end
for i = #threads, 1, -1 do
temp = threads[i]
+7 -9
View File
@@ -211,7 +211,7 @@ function multi:newSystemThreadedProcessor(cores)
return tjq:pop()
end)
if dat then
thread:newThread("test",function()
thread:newThread("JQ-TargetThread",function()
local name = table.remove(dat, 1)
local jid = table.remove(dat, 1)
local args = table.remove(dat, 1)
@@ -387,22 +387,20 @@ function multi:newSystemThreadedProcessor(cores)
for i,v in pairs(self.proc_list) do
local conn
local jid = self:pushJob(v, func)
conn = c.jobqueue.OnJobCompleted(function(id, data)
conn = self.jobqueue.OnJobCompleted(function(id, data)
if id == jid then
loads[v] = data
multi:newAlarm(1):OnRing(function(alarm)
c.jobqueue.OnJobCompleted:Unconnect(conn)
alarm:Destroy()
table.insert(loads, {v, data})
multi:newTask(function()
self.jobqueue.OnJobCompleted:Unconnect(conn)
end)
end
end)
end
thread.hold(function() return #loads == c.cores end)
return loads
end)
end, true)
return c
end