Bug #4289 » 0001-timeout.rb-avoid-introducing-new-class-for-every-tim.patch
lib/timeout.rb | ||
---|---|---|
# so you can call it directly as Timeout.timeout().
|
||
def timeout(sec, klass = nil) #:yield: +sec+
|
||
return yield(sec) if sec == nil or sec.zero?
|
||
exception = klass || Class.new(ExitException)
|
||
exception = klass || ExitException
|
||
begin
|
||
x = Thread.current
|
||
y = Thread.start {
|