Bug #4289 ยป 0001-timeout.rb-avoid-introducing-new-class-for-every-tim.patch
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 |
- |