aboutsummaryrefslogtreecommitdiffstats
path: root/lib/timeout.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-14 14:51:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-14 14:51:42 +0000
commit6c6a24826c5fda68e04e71ac17620b0e70bca265 (patch)
treec2692457fbae375c8a38fd64a90a852365e331fc /lib/timeout.rb
parent1a760a6f76e5b2fad343fce10ebf831fe22286b4 (diff)
downloadruby-6c6a24826c5fda68e04e71ac17620b0e70bca265.tar.gz
* enum.c (enum_min_by): new method Enum#min_by. added Enum#max_by
as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 {