love.thread (简体中文)
Available since LÖVE 0.7.0 |
This module is not supported in earlier versions. |
Allows you to work with threads.
线程是独立的Lua环境,平行运行于主代码。它们分别运行各自的代码,可以用来进行复杂的操作而不影响主线程的帧速率。然而,因为它们是独立的环境下,所以它们不能访问主线程的变量和函数,以及线程间的通信。
当一个线程启动时, 它只加载love.thread模块. 所有其他的模块需要用require加载.
love.graphics模块有一些限制,因此它应该只在主线程使用. |
Contents
Types
Channel | An object which can be used to send and receive data between different threads. |
Thread | A Thread represents a thread. |
Functions
love.thread.getChannel | Creates or retrieves a named thread channel. |
love.thread.getThread | Look for a thread and get its object. |
love.thread.getThreads | Get all threads. |
love.thread.newChannel | Creates a new unnamed thread channel. |
love.thread.newThread | Creates a new Thread from a filename, string or FileData object containing Lua code. |
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info