skynet.coroutine.status may return blocked

This commit is contained in:
Cloud Wu
2015-12-17 17:11:54 +08:00
parent 872491e968
commit 4a80a75fd6
2 changed files with 34 additions and 7 deletions

View File

@@ -80,6 +80,19 @@ end
end -- end of skynetco.resume
function skynetco.status(co)
local status = coroutine.status(co)
if status == "suspended" then
if skynet_coroutines[co] == false then
return "blocked"
else
return "suspended"
end
else
return status
end
end
function skynetco.yield(...)
return coroutine_yield("USER", ...)
end