fix typo: coroutine_pool

This commit is contained in:
云风
2013-10-30 16:48:04 +08:00
parent feb2efddbe
commit 09242894a3

View File

@@ -30,17 +30,17 @@ local trace_func = function() end
-- coroutine reuse -- coroutine reuse
local coroutine_poll = {} local coroutine_pool = {}
local coroutine_yield = coroutine.yield local coroutine_yield = coroutine.yield
local function co_create(f) local function co_create(f)
local co = table.remove(coroutine_poll) local co = table.remove(coroutine_pool)
if co == nil then if co == nil then
co = coroutine.create(function(...) co = coroutine.create(function(...)
f(...) f(...)
while true do while true do
f = nil f = nil
coroutine_poll[#coroutine_poll] = co coroutine_pool[#coroutine_pool] = co
f = coroutine_yield "EXIT" f = coroutine_yield "EXIT"
f(coroutine_yield()) f(coroutine_yield())
end end
@@ -481,7 +481,7 @@ function dbgcmd.MEM()
end end
function dbgcmd.GC() function dbgcmd.GC()
coroutine_poll = {} coroutine_pool = {}
collectgarbage "collect" collectgarbage "collect"
end end