Thread Operations from Within Threads Themselves : stop « Threads « Ruby






Thread Operations from Within Threads Themselves


Thread.new do
  10.times do |i|
    print i
    $stdout.flush
    Thread.stop
  end
end

 








Related examples in the same category

1.Stop a thread