Difference between revisions of "Coroutine.status"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")  | 
				|||
| Line 5: | Line 5: | ||
=== Description ===  | === Description ===  | ||
Returns the status of coroutine co as a string.  | Returns the status of coroutine co as a string.  | ||
| − | <  | + | <syntaxhighlight lang="lua">  | 
(string) = coroutine.status(co)  | (string) = coroutine.status(co)  | ||
</source>  | </source>  | ||
Revision as of 14:26, 13 July 2023
Available since: Gideros 2011.6
Class: coroutine
Description
Returns the status of coroutine co as a string. <syntaxhighlight lang="lua"> (string) = coroutine.status(co) </source>
'running', if the coroutine is running (that is, it called status); 'suspended', if the coroutine is suspended in a call to yield, or if it has not started running yet; 'normal' if the coroutine is active but not running (that is, it has resumed another coroutine); and 'dead' if the coroutine has finished its body function, or if it has stopped with an error
Parameters
co: (thread) coroutine to check status for
Return values
Returns (string) the state of coroutine