coroutine.status

From GMod Wiki

Jump to: navigation, search
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: NewerShared.png
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

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox