るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.032秒)

別のキーワード

  1. _builtin enclose
  2. threadgroup enclose
  3. enclose _builtin
  4. enclose threaderror
  5. enclose threadgroup

クラス

キーワード

検索結果

ThreadGroup#enclose -> self (18138.0)

自身への ThreadGroup#add によるスレッドの追加・削除を禁止します。 enclose された ThreadGroup に追加や削除を行うと例外 ThreadError が発生します。

...るスレッドの追加・削除を禁止します。
enclose
された ThreadGroup に追加や削除を行うと例外 ThreadError が発生します。

ただし、Thread.new によるスレッドの追加は禁止されません。enclose されたスレッドグループ A に
属するスレ...
...new.enclose
thg.add Thread.new {}

=> -:2:in `add': can't move to the enclosed thread group (ThreadError)

削除の例:

thg1 = ThreadGroup.new
thg2 = ThreadGroup.new

th = Thread.new {sleep 1}

thg1.add th
thg1.enclose
thg2.add th

=> -:8:in `add': can't move from the enclosed th...

ThreadGroup#enclosed? -> bool (6131.0)

自身が enclose されているなら true を返します。そうでないなら false を返します。デフォルトは false です。

...自身が enclose されているなら true を返します。そうでないなら false を返します。デフォルトは false です。

freeze された ThreadGroup には Thread の追加/削除ができませんが、enclosed? は false を返します。

thg = ThreadGroup.new
p...
...thg.enclosed? # => false
thg.enclose
p thg.enclosed? # => true

thg = ThreadGroup.new
p thg.enclosed? # => false
thg.freeze
p thg.enclosed? # => false

@see ThreadGroup#enclose...

ThreadGroup#add(thread) -> self (15.0)

スレッド thread が属するグループを自身に変更します。

...ドを指定します。

@raise ThreadError 自身が freeze されているか enclose されている場合に、発生します。また引数 thread が属する ThreadGroup が freeze されているか enclose されている場合にも発生します。

//emlist[例][ruby]{
puts "Initial g...