Lua:inMainThread

From Cheat Engine
Revision as of 00:35, 11 July 2025 by Leunsel (talk | contribs) (Created page with "Category:Lua '''function''' inMainThread() ''':''' Boolean Returns true if the current code is running inside the main thread. Available in Cheat Engine 6.4 and later....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

function inMainThread() : Boolean

Returns true if the current code is running inside the main thread. Available in Cheat Engine 6.4 and later.

Function Parameters[edit]

None.

Returns[edit]

Boolean — true if running in the main thread, false otherwise.

Examples[edit]

function ShowError(message)
    if not inMainThread() then
        synchronize(function()
            self:ShowError(message)
        end)
        return
    end
    messageDialog(message, mtError, mbOK)
end

See also[edit]