summaryrefslogtreecommitdiff
path: root/lib/timeout.rb
diff options
context:
space:
mode:
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 d4ea758acd6..75340d52dd4 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