-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy paththread.lua
More file actions
51 lines (43 loc) · 1.88 KB
/
thread.lua
File metadata and controls
51 lines (43 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
-- Allows you to work with threads.
--
--Threads are separate Lua environments, running in parallel to the main code. As their code runs separately, they can be used to compute complex operations without adversely affecting the frame rate of the main thread. However, as they are separate environments, they cannot access the variables and functions of the main thread, and communication between threads is limited.
--
--When a Thread is started, it only loads the love.thread module. Every other module has to be loaded with require.
--
-- NOTE: The love.graphics module has several restrictions and therefore should only be used in the main thread.
--
-- @module thread
--
---
-- Look for a thread and get its object.
-- @function [parent = #thread] getThread
-- @param #string name The name of the thread to return.
-- @return thread The thread with that name.
---
-- Look for a thread and get its object.
-- @function [parent = #thread] getThread
-- @return thread The current thread.
---
-- Get all threads.
-- @function [parent = #thread] getThreads
-- @return #table threads A table containing all threads indexed by their names.
---
-- Creates a new Thread from a File or Data Object.
-- @function [parent = #thread] newThread
-- @param #string name The name of the thread.
-- @param #string filename The name of the file to use as source.
-- @return thread A new Thread that has yet to be started.
---
-- Creates a new Thread from a File or Data Object.
-- @function [parent = #thread] newThread
-- @param #string name The name of the thread.
-- @param file The File to use as source.
-- @return thread A new Thread that has yet to be started.
---
-- Creates a new Thread from a File or Data Object.
-- @function [parent = #thread] newThread
-- @param #string name The name of the thread.
-- @param data The Data to use as source.
-- @return thread A new Thread that has yet to be started.
return nil