Skip to main content

GetThreadName

This function was added in DSL 4

Description

Return the name of thread or of the current thread. It is possible this function will not return anything if the thread was not created with a name.

function GetThreadName(thread) --[[ ... ]] end

Parameters

  • thread?: thread|nil - (Optional) The thread to get the name of. If not provided, the current thread is used.

Return Values

  • name: string|nil - The name of the thread, or nil if the thread was not created with a name.

Example

function MyThreadFunction()
print('This is my thread function')
print('Thread name:', GetThreadName(thread))
end

thread = CreateThread('MyThreadFunction')

See Also