instance method
ThreadGroup#list
() -> ::Array[::Thread]
thgrp.list → array
thread.c
View on GitHub ↗
static VALUE
thgroup_list(VALUE group)
{
VALUE ary = rb_ary_new();
rb_thread_t *th = 0;
rb_ractor_t *r = GET_RACTOR();
ccan_list_for_each(&r->threads.set, th, lt_node) {
if (th->thgroup == group) {
rb_ary_push(ary, th->self);
}
}
return ary;
}
Returns an array of all existing Thread objects that belong to this group.
Example
ThreadGroup::Default.list #=> [#<Thread:0x401bdf4c run>]