Difference between revisions of "Thread.yield"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' 2018.10<br/>
'''<translate>Available since</translate>:''' 2018.10<br/>
+
'''Class:''' [[Thread]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Thread|Thread]]<br/>
 
  
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Pauses executions of thread (only a valid call inside thread function). Supplied arguments
+
Pauses executions of thread (only a valid call inside thread function). Supplied arguments can be retreived by a subsequent call to resume.
can be retreived by a subsequent call to resume.
+
<source lang="lua">
</translate><br/>
+
local ok, ... = Thread.yield(...)
<source lang="lua">local ok, ... = Thread.yield(...)</source>
+
</source>
  
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''...: ''' ''(misc)'' <translate>arguments for next resume call to collect as return values</translate><br/>
+
'''...: ''' ''(misc)'' arguments for next resume call to collect as return values<br/>
=== <translate>Return values</translate> ===
+
 
'''ok: ''' ''(boolean)'' <translate>success</translate><br/>
+
=== Return values ===
'''...: ''' ''(misc)'' <translate>arguments provided by resume call</translate><br/>
+
'''ok: ''' ''(boolean)'' success<br/>
 +
'''...: ''' ''(misc)'' arguments provided by resume call<br/>
  
 
{{Thread}}
 
{{Thread}}

Revision as of 04:39, 11 June 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