Stop a thread : stop « Threads « Ruby






Stop a thread

alarm = Thread.new(self) { sleep(5); Thread.main.wakeup }
puts "Goodbye!";
Thread.stop;
puts "back"

 








Related examples in the same category

1.Thread Operations from Within Threads Themselves