Threads

getthreadidentity

Returns the identity level for a thread or the current thread.

Syntax

getthreadidentity(thread?: thread): integer
Aliases get_thread_identitygetidentitygetthreadcapsgetthreadcontextget_thread_context

Arguments

NameTypeDescription
thread?threadThread to inspect or run inside.

Returns

NameTypeDescription
identityintegerThread identity level.

Description

Returns the identity level for a thread or the current thread.

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

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

Example

Example call with placeholder values.

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