Project

General

Profile

Bug #17164 ยป neverexit.rb

spraints (Matt Burke), 09/10/2020 07:52 PM

 
1
Thread.new do
2
  puts "Starting thread"
3
  loop do
4
    begin
5
      should_raise = true
6
      begin
7
        sleep 1
8
        should_raise = false
9
        puts "... tick (thread state = #{Thread.current.status})"
10
      ensure
11
        raise "boom" if should_raise
12
      end
13
    rescue => e
14
      puts "ignoring #{e.message} (#{e.class})"
15
    end
16
  end
17
end
18

    
19
# Let the thread get started.
20
sleep 1.5
21
puts "all done! exiting..."