Thread:is_dead

Returns whether this thread has ran to completion or stopped.

Usage

thread:is_dead()

Returns

Name Type Description
dead boolean True if this thread has ran to completion or stopped.

Examples

local script = crystal.Script:new();
local thread = script:run_thread(function(self)
  print("Hello and goodbye");
end);
assert(thread:is_dead());
local script = crystal.Script:new();
local thread = script:run_thread(function(self)
  self:wait(5);
end);
assert(not thread:is_dead());

This site uses Just the Docs, a documentation theme for Jekyll.