Fixed issue with double thread activations (Looking for another solution)

This commit is contained in:
2023-01-17 23:45:26 -05:00
parent a7a902acd6
commit 6ed5555706
3 changed files with 22 additions and 22 deletions
+2 -2
View File
@@ -55,10 +55,10 @@ local count = 1
local started = false
local livingThreads = {}
function THREAD:newFunction(func,holdme)
function THREAD:newFunction(func, holdme)
return thread:newFunctionBase(function(...)
return multi:newSystemThread("TempSystemThread",func,...)
end,holdme)()
end, holdme)()
end
function multi:newSystemThread(name, func, ...)
+4 -4
View File
@@ -72,7 +72,7 @@ function multi:newSystemThread(name,func,...)
return c.name
end
thread:newThread(function()
if name:find("TempSystemThread") then
if name == "TempSystemThread" then
local status_channel = love.thread.getChannel("__"..c.ID.."__MULTI__STATUS_CHANNEL__")
thread.hold(function()
-- While the thread is running we might as well do something in the loop
@@ -101,10 +101,10 @@ function multi:newSystemThread(name,func,...)
return c
end
function THREAD:newFunction(func)
function THREAD:newFunction(func, holdme)
return thread:newFunctionBase(function(...)
return multi:newSystemThread("TempSystemThread"..THREAD_ID,func,...)
end)()
return multi:newSystemThread("TempSystemThread", func, ...)
end, holdme)()
end
THREAD.newSystemThread = multi.newSystemThread