Vital.sandbox
Thread

self:destroy

Shared

Destroys an existing thread


Syntax

local status = self:destroy()

Parameters

TypeNameDescription

Returns

TypeNameDescription
boolstatustrue on successful execution, or false on failure

Examples

Destroy a thread context
local self = thread:create(function(self)
    engine.print("info", "Hello from thread")
end)

self:resume()
self:destroy()

On this page