Skip to main content

status

Function status 

Source
pub fn status(co: thread) -> string
Expand description

Returns the status of the coroutine co, as a string: "running", "suspended", "normal" (active but not running), or "dead".

§Examples

local co = coroutine.create(function() coroutine.yield() end)
print(coroutine.status(co))    --> suspended
coroutine.resume(co)
print(coroutine.status(co))    --> suspended   (stopped at the yield)
coroutine.resume(co)
print(coroutine.status(co))    --> dead