1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-10-14 14:44:58 +00:00
parent 52f90f6566
commit cef64ee0ba
4 changed files with 104 additions and 68 deletions

View file

@ -39,6 +39,12 @@ def timeout(sec)
yield sec
return true
ensure
Thread.kill y if y.alive?
Thread.kill y if y and y.alive?
end
end
if __FILE__ == $0
timeout(5) {
p 10
}
end