coroutine.status

From GMod Wiki

Revision as of 06:36, 2 February 2011 by Donkie (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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