Wait for a thread to die in Ruby
Figured it out; you can still #join
the thread after killing it, so you can use thread.kill.join
to block until the thread dies.
This code never prints Not dead:
thread = Thread.new { loop {} }
thread.kill.join
puts "Not dead" while thread.alive?