summaryrefslogtreecommitdiff
path: root/lib/timeout.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-05 04:41:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-05 04:41:21 +0000
commitde7161526014b781468cea5d84411e23be945f79 (patch)
treece7e90b3c16ce6246be9850c9b1ea1328992c0e7 /lib/timeout.rb
parenta1d1b1516750c1047ceb7010f8f5ca34b358c7e3 (diff)
20000105
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/timeout.rb')
-rw-r--r--lib/timeout.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index d4ea758acd..75340d52dd 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -32,11 +32,11 @@ def timeout(sec)
x = Thread.current
y = Thread.start {
sleep sec
- x.raise TimeoutError, "execution expired" if x.status
+ x.raise TimeoutError, "execution expired" if x.alive?
}
yield sec
return true
ensure
- Thread.kill y if y.status
+ Thread.kill y if y.alive?
end
end