summaryrefslogtreecommitdiff
path: root/lib/timeout.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/timeout.rb')
-rw-r--r--lib/timeout.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index ba93a62f157..4e6f546e0c4 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -29,6 +29,7 @@ class TimeoutError<StandardError
end
def timeout(sec)
+ return yield if sec == nil
begin
x = Thread.current
y = Thread.start {