Thread
| Available since LÖVE 0.7.0 |
| This type is not supported in earlier versions. |
A Thread is a chunk of code that can run in parallel with other threads.
Constructors
| love.thread.newThread | Creates a new Thread from a Lua file or FileData object. |
|
Functions
| Object:type | Gets the type of the object as a string. | ||
| Object:typeOf | Checks whether an object is of a certain type. | ||
| Thread:demand | Receive a message from a thread. Wait for the message to exist before returning. |
|
|
| Thread:get | Get a value. |
|
|
| Thread:getError | Retrieves the error string from the thread. |
|
|
| Thread:getKeys | Returns the names of all messages as a table. |
|
|
| Thread:getName | Get the name of a thread. |
|
|
| Thread:isRunning | Returns whether the thread is currently running. |
|
|
| Thread:kill | Forcefully terminate the thread. |
|
|
| Thread:peek | Receive a message from a thread, but leave it in the message box. |
|
|
| Thread:receive | Receive a message from a thread. |
|
|
| Thread:send | Send a message. |
|
|
| Thread:set | Set a value. |
|
|
| Thread:start | Starts the thread. |
|
|
| Thread:wait | Wait for a thread to finish. |
|
Supertypes
Notes
| Removed in LÖVE 0.9.0 |
| This method for retrieving errors has been replaced by Thread:getError and love.threaderror. |
If a Lua error occurs in the thread, a message with the name "error" gets pushed to its message pool. Retrieve the message with Thread:get('error').
See Also
Category: