-
Notifications
You must be signed in to change notification settings - Fork 74
Sdl createThread
Tangent 128 edited this page Mar 28, 2015
·
3 revisions
Create a separate thread of execution. It is highly recommended to not discard the value of the function and to wait the thread before exiting.
You can pass optional parameters to the thread source except userdata and functions.
function SDL.createThread(name, path, ...)
- name, the thread name as a string
- path, the path to the file
- ..., the optional arguments passed to the file
- a Thread object or nil
- the error message
local t = SDL.createThread("name", "drawing.lua")
function SDL.createThread(name, func, ...)
- name, the thread name as a string
- func, the function to be called
- ..., the optional arguments passed to the file
- a Thread object or nil
- the error message
local function job()
while true do
print("...")
end
end
local t = SDL.createThread("name", job)