Thread#handle_interrupt does not prevent Thread#kill from interrupting
According to the documentation above,
Thread#handle_interrupt(Exception => :never) would prevent the interrupts from
In the following code, however, the
Thread#kill seems to just kill the thread immediately even if the thread is instructed to never handle interrupt.
t = Thread.new do Thread.handle_interrupt(Exception => :never) do puts "thread started" sleep 2 puts "thread end" end end sleep 1 t.kill puts "main end" sleep 2
$ ruby test.rb thread started main end $
Is the document wrong? Or, implementation not working as expected?