singleton method ThreadGroup.new

new -> ThreadGroup[permalink][rdoc][edit]

新たな ThreadGroup を生成して返します。



thread_group = ThreadGroup.new
thread_group.add Thread.new { sleep 0.1; Thread.new { sleep 1 }; sleep 1 }
thread_group.add Thread.new { sleep 2 }
sleep 0.5
thread_group.list # => [#<Thread:0x007fc6f1842d70 sleep>, #<Thread:0x007fc6f1842c80 sleep>, #<Thread:0x007fc6f080dba8 sleep>]