Difference between revisions of "Lua:synchronize"
Jump to navigation
Jump to search
(Created page with "Category:Lua '''function''' synchronize(''Function'', ...) ''':''' any Calls the given function from the main thread, passing any additional arguments. Returns the retu...") |
(No difference)
|
Latest revision as of 00:37, 11 July 2025
function synchronize(Function, ...) : any
Calls the given function from the main thread, passing any additional arguments. Returns the return value(s) of the given function.
Function Parameters[edit]
Parameter | Type | Description |
---|---|---|
Function | Function | The function to execute in the main thread. |
... | Any | Optional arguments to pass to the function. |
Returns[edit]
The return value(s) of the given function.
Examples[edit]
function ShowError(message) if not inMainThread() then synchronize(function() self:ShowError(message) end) return end messageDialog(message, mtError, mbOK) end