module Patch::Thread

Public Class Methods

new() { || ... } click to toggle source
# File lib/patch/thread.rb, line 5
def self.new(&block)
  thread = ::Thread.new do
    begin
      yield
    rescue Exception => exception
      ::Thread.main.raise(exception)
    end
  end
  thread.abort_on_exception = true
  thread
end