self:destroy

Shared

Destroys the thread instance and frees its resources


Syntax

local status = self:destroy()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Destroy a thread instance
local entity = util.thread.create(function(self)
    core.engine.print("info", "Hello from thread")
end)

entity:resume()
entity:destroy()

On this page