[#2023] Class Method の index — (Dezawa Shin-ichiro) <dezawa@...>

出沢です

13 messages 1997/02/02

[#2158] [Req] pack/unpack — keiju@... (Keiju ISHITSUKA)

けいじゅ@SHLジャパンです.

14 messages 1997/02/18
[#2166] Re: [Req] pack/unpack — matz@... (Yukihiro Matsumoto) 1997/02/18

まつもと ゆきひろです.

[#2277] ruby 1.0-970228 available — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです.

16 messages 1997/02/28

[ruby-list:2113] Re: Thread, Exception and Timeout

From: sinara@...
Date: 1997-02-12 06:41:28 UTC
List: ruby-list #2113
原です。

> まつもと ゆきひろです.

> とかいってるあいだに作っちゃいました.^^;;;

うわっと。(^^

と、いうことは、最初のように

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

というのも可能になるわけですね。

In This Thread