coroutine.status
From GMod Wiki
Function | |
Syntax |
coroutine.status( Thread thread ) Where is this used? |
Description: | |
Returns the status of a given coroutine (thread). It can be one of these states: suspended, running, and dead. | |
Returns: | String status |
Part of Library: | Corout |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Coroutine.status]Coroutine.status [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
co = coroutine.create(function () print("hi") end) print(coroutine.status(co)) // Output: suspended coroutine.resume(co) // Output: hi print(coroutine.status(co)) // Output: dead
See Also
- Coroutine.resume
- Coroutine.status
- Lua How To Coroutines