diff --git a/lib/timeout.rb b/lib/timeout.rb index 79d28b6c5e..792a7c1093 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -73,11 +73,13 @@ module Timeout def timeout(sec, klass = nil) #:yield: +sec+ return yield(sec) if sec == nil or sec.zero? message = "execution expired".freeze + from = "from #{caller_locations(1, 1)[0]}" if $DEBUG e = Error bl = proc do |exception| begin x = Thread.current y = Thread.start { + Thread.current.name = from begin sleep sec rescue => e