isexecutorthread
Checks whether a thread belongs to your scripts.
Syntax
isexecutorthread(thread: thread?) -> boolean
Also available as
is_executor_thread
Parameters
| Parameter | Type | Description |
|---|---|---|
thread | thread? | The thread to check. Defaults to the current thread. |
Returns
| Type | Description |
|---|---|
boolean | true when the thread runs your code. |
Description
Threads you start, and threads the engine runs for callbacks you connected, count as yours. Game threads return false.
Example
print(isexecutorthread())
for _, thread in getallthreads() do
if not isexecutorthread(thread) then
print("game thread", thread)
break
end
end
These are Game executor contracts. Check build requirements and session lifetimes before using them.
