Coroutine (type)
From ComputerCraft Wiki
Revision as of 18:24, 22 April 2013 by Hawk777 (Talk | contribs) (Remove old crud, simplify, and point back at the API page for more details, which now exist)
This is for the coroutine type, displayed as thread in the Lua language. For the API, visit Coroutine (API).
A coroutine, or thread, is an object which contains an execution context in a Lua program. A coroutine wraps up the location of the next statement to execute, the complete call stack of functions called to reach that statement, the local variables in those functions, and any other data needed to freeze, and subsequently thaw and resume, a running code sequence, as though nothing happened.
For details on how coroutines are used, see the coroutine API.