From: sinara@... Date: 1997-02-12T15:41:28+09:00 Subject: [ruby-list:2113] Re: Thread, Exception and Timeout 原です。 > まつもと ゆきひろです. > とかいってるあいだに作っちゃいました.^^;;; うわっと。(^^ と、いうことは、最初のように class Timeout def initialize(sec, msg = "timeout") @parent = Thread.current @timer = Thread.start { sleep(sec) @parent.raise TimeoutError, msg } end def off if @timer.status Thread.kill @timer @timer = nil end end end というのも可能になるわけですね。