-
Notifications
You must be signed in to change notification settings - Fork 2
Reference
This page describes all the functions and values exported by the binary module and the threading.lua module.
- Globals:
- Metatables:
The functions and values in this table are all also available when using the gthread table but you will not be able to use all the functions provided by the threading module if you use it.
Creates a new thread.
Parameters:
- type: threading.CONTEXTYPE_* (unused)
Returns:
- [GThread object]
Creates a new single channel.
Parameters: /
Returns:
- [GThreadChannel object]
Creates a new packet. Optionally assign it a tag for filtering.
Parameters:
- tag: number
Returns:
- [GThreadPacket object]
Returns all GThread objects that were garbage-collected.
Parameters: /
Returns:
- table ( [GThread object] )
CONTEXTYPE_ISOLATED
Head enum for GThreadPacket:Seek()
HEAD_W
HEAD_R
Location enum for GThreadPacket:Seek()
LOC_START
LOC_CUR
LOC_END
Version of the gthread module
The global object engine represents the thread itself and is only available inside GThread contexts.
Blocks the thread execution until one of the passed handles is ready. Returns which handle was marked as ready along with its results.
Parameters:
- handles: varargs... ( number )
Returns:
- handle: number
- ...
Timing:
- Blocks until a handle in `handles` is ready
Equivalent of GThread:OpenChannel() with the return values flipped.
Creates a timer handle that will resolve in the given amount of milliseconds.
Parameters:
- ms: number
Returns:
- handle: number
*Added by threading.lua
Creates a timer and blocks on it. if ran in a coroutine it will yield the coroutine instead. (passing the created handle)
Parameters:
- ms: number
Returns:
- handle: number
Timing:
- Blocks for `ms` milliseconds
Equivalent of threading.newChannel()
Equivalent of threading.newPacket()
Equivalent of threading.HEAD\_\*
Equivalent of threading.LOC\_\*
These are the functions available on objects returned by threading.newThread().
These are the functions available on objects returned by threading.newChannel().
The Data functions are also available.
These are the functions available on objects returned by threading.newPacket().
The Data functions are also available.
These functions apply to both GThreadPacket and GThreadChannel objects.
In the case of GThreadChannel:
- Write* functions use the outgoing packet of the channel object.
- Read* functions use the incoming packet of the channel object.