class Eventbox::Thread

This is a workaround for bug github.com/jruby/jruby/issues/5314 which was fixed in JRuby-9.2.1.0.

Public Class Methods

new(*args, &block) click to toggle source
Calls superclass method
# File lib/eventbox.rb, line 27
def initialize(*args, &block)
  started = Queue.new
  super do
    Thread.handle_interrupt(Exception => :never) do
      started << true
      block.call(*args)
      # Immediately stop the thread, before the handle_interrupt has finished.
      # This is necessary for JRuby to avoid possoble signal handling after the block.
      Thread.exit
    end
  end
  started.pop
end