Difference between revisions of "Thread"

From GiderosMobile
(Created page with "__NOTOC__ <languages /> <!-- GIDEROSOBJ:Thread --> '''<translate>Supported platforms</translate>:''' File:Platform android.pngFile:Platform ios.pngFile:Platform pc.p...")
 
Line 5: Line 5:
 
'''<translate>Available since</translate>:''' 2018.10<br/>
 
'''<translate>Available since</translate>:''' 2018.10<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
<translate>  </translate><br/>
+
<translate>  Main Thread class that concurrent threads are created and managed by. From [[Special:MyLanguage/Threads|Threads]] plugin.
 +
  </translate><br/>
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|

Revision as of 23:01, 6 October 2018


Supported platforms: Platform android.pngPlatform ios.pngPlatform pc.pngPlatform mac.pngPlatform winrt.pngPlatform win32.png
Available since: 2018.10

Description

 Main Thread class that concurrent threads are created and managed by. From Threads plugin.
 

Methods

Thread.new Creates a new thread object.
Thread:setFunction Sets Lua function that thread will execute.
Thread:execute Starts/executes our thread
Thread:resume Resumes a thread that has been yielded.
Thread.yield Pauses executions of thread (only a valid call inside thread function).
Thread:status Returns current status of the thread.
Thread:getNumLogicalCores Returns number of logical cores on host machine.
Thread:requestTermination Sets a flag to terminate thread.
Thread.sendData Sends data for retrieval by main thread (only a valid call inside thread function).
Thread:fetchData Returns any data sent by thread sendData call.
Thread:getResults Get any results from thread.

Events

none

Constants

none