coroutine.resume

Start or resume a thread

Prototype

ok, args = coroutine.resume (thread, v1, v2, ...)

Description

Start or resume a thread created by coroutine.create. Any values supplied after the thread are returned as results from the coroutine.yield inside the thread. If this is the first call for this thread, the values are supplied to the function itself.

On success, returns true, followed by arguments to the coroutine.yield inside the function (if called), or the return value of the function itself.

On failure, returns false followed by an error message.

assert (coroutine.resume (thread, 45, 67)) 

Lua functions

Topics