From: gotoken@... (GOTO Kentaro) Date: 2000-03-29T14:14:03+09:00 Subject: [ruby-dev:9525] Re: timeout しない timeout ごとけんです In message "[ruby-dev:9524] Re: timeout しない timeout" on 00/03/29, ARIMA Yasuhiro writes: >nil や false の指定で timeout しないで動くようにするための >ruby-1.4.4 の lib/timeout.rb に対する patch です。 >こんな感じでしょうか?> gotoken さん >--- timeout.rb.orig Tue Mar 21 12:24:54 2000 >+++ timeout.rb Wed Mar 29 13:08:59 2000 >@@ -26,6 +26,10 @@ > end > > def timeout(sec) >+ if not sec >+ yield sec >+ return true >+ end > begin > x = Thread.current > y = Thread.start { sec を yield に渡す必要は感じませんです。 return yield unless sec くらいでいいような気もします。 -- gotoken