Project

General

Profile

Bug #9354 ยป timeout_klass_arg.patch

tmm1 (Aman Karmani), 01/03/2014 07:09 PM

View differences:

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
    (1-1/1)