Changes to threads

This commit is contained in:
2023-05-07 23:03:15 -04:00
parent ec9f7dec61
commit a5add93747
12 changed files with 63 additions and 67 deletions
+3 -3
View File
@@ -196,7 +196,7 @@ function multi:newSystemThreadedConnection(name)
end
return r
end
c.CID = THREAD.getID()
c.CID = THREAD_ID
c.subscribe = multi:newSystemThreadedQueue("SUB_STC_"..self.Name):init()
c.Name = name
c.links = {} -- All triggers sent from main connection. When a connection is triggered on another thread, they speak to the main then send stuff out.
@@ -262,7 +262,7 @@ function multi:newSystemThreadedConnection(name)
function c:Fire(...)
local args = {...}
if self.CID == THREAD.getID() then -- Host Call
if self.CID == THREAD_ID then -- Host Call
for _, link in pairs(self.links) do
link:push {self.TRIG, args}
end
@@ -284,7 +284,7 @@ function multi:newSystemThreadedConnection(name)
tempMT.__index = self.proxy_conn
tempMT.__call = function(t,func) self.proxy_conn(func) end
setmetatable(self, tempMT)
if self.CID == THREAD.getID() then return self end
if self.CID == THREAD_ID then return self end
thread:newThread("STC_CONN_MAN"..name,function()
local item
local link_self_ref = multi:newSystemThreadedQueue()
-8
View File
@@ -88,14 +88,6 @@ local function INIT(__GlobalLinda, __SleepingLinda, __StatusLinda, __Console)
function THREAD.kill() -- trigger the lane destruction
error("Thread was killed!\1")
end
function THREAD.getName()
return THREAD_NAME
end
function THREAD.getID()
return THREAD_ID
end
function THREAD.pushStatus(...)
local args = {...}