るりまサーチ

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

別のキーワード

  1. _builtin enclosed?
  2. threadgroup enclosed?
  3. enclosed? _builtin
  4. enclosed? threadgroup

ライブラリ

クラス

キーワード

検索結果

ThreadGroup#enclosed? -> bool (6132.0)

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

...できませんが、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...

ThreadGroup#enclose -> self (13.0)

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

...ad.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 thread group (ThreadError)...