mirror of
https://github.com/rayaman/multi.git
synced 2026-09-05 07:27:35 -04:00
Fixed issue with double thread activations (Looking for another solution)
This commit is contained in:
@@ -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, ...)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user