coroutine.status

Returns the status of a thread

Prototype

s = coroutine.status (thread)

Description

Returns a string indicating the status of the thread. Raises an error if the argument is not a thread.

If it is, the values returned can be: A thread is "running" if coroutine.status is called from within the thread itself.

A thread is "normal" if the coroutine is active, but has resumed another coroutine.

It is "suspended" after being created but before it is resumed, and after yielding.

It is "dead" after it has returned from the entire function.

print (coroutine.status (thread)) --> suspended

Lua functions

Topics