Bug #9354 ยป timeout_klass_arg.patch
| lib/timeout.rb | ||
|---|---|---|
|
return yield(sec) if sec == nil or sec.zero?
|
||
|
message = "execution expired"
|
||
|
e = Error
|
||
|
bt = catch((klass||ExitException).new) do |exception|
|
||
|
klass ||= ExitException
|
||
|
bt = catch(klass.new(message)) do |exception|
|
||
|
begin
|
||
|
x = Thread.current
|
||
|
y = Thread.start {
|
||
| ... | ... | |
|
rescue => e
|
||
|
x.raise e
|
||
|
else
|
||
|
x.raise exception, message
|
||
|
x.raise exception
|
||
|
end
|
||
|
}
|
||
|
return yield(sec)
|
||
|
rescue (klass||ExitException) => e
|
||
|
rescue klass => e
|
||
|
e.backtrace
|
||
|
ensure
|
||
|
if y
|
||