Thread (Deutsch)

Available since LÖVE 0.7.0
This type is not supported in earlier versions.

Ein Thread ist ein Code-Baustein, der parallel zu anderen Threads ausgeführt werden kann.

Konstruktoren

love.thread.newThread Creates a new Thread from a filename, string or FileData object containing Lua code. Added since 0.7.0

Funktionen

Object:release Immediately destroys the object's Lua reference. Added since 11.0
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. Added since 0.7.0 Removed in 0.9.0
Thread:get Get a value. Added since 0.8.0 Removed in 0.9.0
Thread:getError Retrieves the error string from the thread. Added since 0.9.0
Thread:getKeys Returns the names of all messages as a table. Added since 0.8.0 Removed in 0.9.0
Thread:getName Get the name of a thread. Added since 0.7.0 Removed in 0.9.0
Thread:isRunning Returns whether the thread is currently running. Added since 0.9.0
Thread:kill Forcefully terminate the thread. Added since 0.7.0 Removed in 0.8.0
Thread:peek Receive a message from a thread, but leave it in the message box. Added since 0.7.0 Removed in 0.9.0
Thread:receive Receive a message from a thread. Added since 0.7.0 Removed in 0.8.0
Thread:send Send a message. Added since 0.7.0 Removed in 0.8.0
Thread:set Set a value. Added since 0.8.0 Removed in 0.9.0
Thread:start Starts the thread. Added since 0.7.0
Thread:wait Wait for a thread to finish. Added since 0.7.0

Supertypen

Anmerkungen

Removed in LÖVE 0.9.0
Diese Methode zur Wiedergabe eines Fehlers wurde durch Thread:getError und love.threaderror ersetzt..

Wenn ein Fehler in einem Thread auftritt, wird eine Nachricht mit dem Namen "error" an den Nachrichten-Pool geschickt. Diese Nachricht kann anschließend durch Thread:get('error') erlangt werden.

Siehe auch

Andere Sprachen