FANDOM


coroutine is a Lua library.

Library functionsEdit

Function name Arguments Returns Description Origin
coroutine.create Function f Thread co Creates a new co-routine with the body f. Originated in Lua 5.2.
coroutine.resume Thread co, ... boolean true, ... Arguments passed from coroutine.yield or return or boolean false, string error message Resumes a running coroutine. Originated in Lua 5.2.
coroutine.running None Returns Description Originated in Lua 5.2.
coroutine.status Thread co String status Description Originated in Lua 5.2.
coroutine.wrap Function f Function co Creates a new co-routine with the body f. The function returned is a function that resumed the coroutine that was created. Originated in Lua 5.2.
coroutine.yield ... Arguments to pass on to coroutine.resume nil Description Originated in Lua 5.2.