Difference between revisions of "Thread.yield"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Pauses executions of thread (only a valid call inside thread function). Supplied arguments can be retreived by a subsequent call to resume.
 
Pauses executions of thread (only a valid call inside thread function). Supplied arguments can be retreived by a subsequent call to resume.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
local ok, ... = Thread.yield(...)
 
local ok, ... = Thread.yield(...)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===

Latest revision as of 14:33, 13 July 2023

Available since: 2018.10
Class: Thread

Description

Pauses executions of thread (only a valid call inside thread function). Supplied arguments can be retreived by a subsequent call to resume.

local ok, ... = Thread.yield(...)

Parameters

...: (misc) arguments for next resume call to collect as return values

Return values

ok: (boolean) success
...: (misc) arguments provided by resume call