Difference between revisions of "X Threads"
From GiderosMobile
(Created page with "__NOTOC__ <languages /> <!-- GIDEROSOBJ:Threads --> '''<translate>Supported platforms</translate>:''' File:Platform android.pngFile:Platform ios.pngFile:Platform pc....") |
|||
Line 9: | Line 9: | ||
<translate>The Threads plugin provides the ability to run Lua code in separate threads, taking advantage of multiple cores where available. | <translate>The Threads plugin provides the ability to run Lua code in separate threads, taking advantage of multiple cores where available. | ||
</translate><br/> | </translate><br/> | ||
+ | |||
=== <translate>Examples</translate> ===<br/> | === <translate>Examples</translate> ===<br/> | ||
Revision as of 17:21, 14 September 2018
Supported platforms:
Available since: 2018.12
Description
The Threads plugin provides the ability to run Lua code in separate threads, taking advantage of multiple cores where available.
=== Examples ===
Simple example of one thread sleeping
require "Threads"
local thread = Thread.new()
thread:setFunction(function() Thread.sleepFor(100000) end)
thread:execute()
local ok = false
while not ok do
ok = thread:getResult()
end
print("woot")
MethodsSpecial:MyLanguage/Thread.new/Thread.new Create a new thread |
blah |