0001-timeout.rb-avoid-introducing-new-class-for-every-tim.patch

Eric Wong, 04/06/2011 07:36 AM

Download (1.33 KB)

View differences:

lib/timeout.rb
42 42
  # so you can call it directly as Timeout.timeout().
43 43
  def timeout(sec, klass = nil)   #:yield: +sec+
44 44
    return yield(sec) if sec == nil or sec.zero?
45
    exception = klass || Class.new(ExitException)
45
    exception = klass || ExitException
46 46
    begin
47 47
      x = Thread.current
48 48
      y = Thread.start {
49
-