Add coroutine wrapper for tracking active coroutines (#9186)

This commit is contained in:
Wires77
2025-11-18 23:55:57 -06:00
committed by GitHub
parent a0d078b576
commit 2397d5b4c5

View File

@@ -42,6 +42,19 @@ if launch.devMode and profiler == nil then
ConPrintf("Unable to Load Profiler")
end
-- Optimize coroutines to run at full framerate
local co_create = coroutine.create
local active_coroutines = setmetatable({}, { __mode = "k" })
function coroutine.create(func)
local co = co_create(func)
active_coroutines[co] = true
return co
end
function coroutine._list()
return active_coroutines
end
-- Class library
common.classes = { }
local function addSuperParents(class, parent)