Threads

isourthread

Returns whether a thread is owned by the executor.

Syntax

isourthread(thread: thread): boolean
Aliases is_our_thread

Arguments

NameTypeDescription
threadthreadThread to inspect or run inside.

Returns

NameTypeDescription
ownedbooleanTrue when the thread is owned by the executor.

Description

Returns whether a thread is owned by the executor.

Call it with 1 parameter(s): thread. The argument table explains which values are required and which ones only refine the behavior.

It returns owned (boolean). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = isourthread(coroutine.running())
print(result)