Difference between revisions of "Thread:setFunction"
From GiderosMobile
(removed language stuff) |
|||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
| − | + | '''Available since:''' 2018.10<br/> | |
| − | ''' | + | '''Class:''' [[Thread]]<br/> |
| − | ''' | ||
| − | === | + | === Description === |
| − | + | Sets a Lua function that thread will execute. Will return false if the function cannot be set because the thread is | |
currently running or suspended. | currently running or suspended. | ||
| − | + | <source lang="lua"> | |
| − | <source lang="lua">local ok = thread:setFunction(func)</source> | + | local ok = thread:setFunction(func) |
| + | </source> | ||
| − | === | + | === Parameters === |
| − | '''func: ''' ''(function)'' | + | '''func: ''' ''(function)'' Lua code to run in thread<br/> |
| − | === | + | |
| − | '''ok: ''' ''(boolean)'' | + | === Return values === |
| + | '''ok: ''' ''(boolean)'' success or failure<br/> | ||
{{Thread}} | {{Thread}} | ||
Revision as of 18:09, 25 April 2021
Available since: 2018.10
Class: Thread
Description
Sets a Lua function that thread will execute. Will return false if the function cannot be set because the thread is currently running or suspended.
local ok = thread:setFunction(func)
Parameters
func: (function) Lua code to run in thread
Return values
ok: (boolean) success or failure