aboutsummaryrefslogtreecommitdiffstats
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 0ba5293d1d..7e3ee81ed0 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -35,6 +35,7 @@ module Timeout
def timeout(sec, exception=Error)
return yield if sec == nil or sec.zero?
+ raise ThreadError, "timeout within critical session" if Thread.critical
begin
x = Thread.current
y = Thread.start {