Thread:stop
Stops this thread. This has the following effects (in order):
- All child threads are stopped (in any order).
- Deferred functions for this thread are executed.
- Threads joining on this one are unblocked (in any order).
Usage
thread:stop()
Examples
local script = crystal.Script:new();
local thread = script:add_thread(function(self)
print("This will not be printed");
end);
thread:stop();
script:update(0); -- Nothing happens