@@ -576,6 +576,8 @@ thread_do_start_proc(rb_thread_t *th)
576
576
577
577
if (th -> invoke_type == thread_invoke_type_ractor_proc ) {
578
578
VALUE self = rb_ractor_self (th -> ractor );
579
+ th -> thgroup = th -> ractor -> thgroup_default = rb_obj_alloc (cThGroup );
580
+
579
581
VM_ASSERT (FIXNUM_P (args ));
580
582
args_len = FIX2INT (args );
581
583
args_ptr = ALLOCA_N (VALUE , args_len );
@@ -796,7 +798,6 @@ struct thread_create_params {
796
798
// for normal proc thread
797
799
VALUE args ;
798
800
VALUE proc ;
799
- VALUE group ;
800
801
801
802
// for ractor
802
803
rb_ractor_t * g ;
@@ -855,13 +856,7 @@ thread_create_core(VALUE thval, struct thread_create_params *params)
855
856
}
856
857
857
858
th -> priority = current_th -> priority ;
858
-
859
- if (params -> group ) {
860
- th -> thgroup = params -> group ;
861
- }
862
- else {
863
- th -> thgroup = current_th -> thgroup ;
864
- }
859
+ th -> thgroup = current_th -> thgroup ;
865
860
866
861
th -> pending_interrupt_queue = rb_ary_hidden_new (0 );
867
862
th -> pending_interrupt_queue_checked = 0 ;
@@ -1001,19 +996,12 @@ rb_thread_create(VALUE (*fn)(void *), void *arg)
1001
996
VALUE
1002
997
rb_thread_create_ractor (rb_ractor_t * r , VALUE args , VALUE proc )
1003
998
{
1004
- VALUE thgroup = r -> thgroup_default = rb_obj_alloc (cThGroup );
1005
- #if RACTOR_CHECK_MODE > 0
1006
- rb_ractor_setup_belonging_to (thgroup , r -> pub .id );
1007
- #endif
1008
-
1009
999
struct thread_create_params params = {
1010
1000
.type = thread_invoke_type_ractor_proc ,
1011
1001
.g = r ,
1012
- .group = thgroup ,
1013
1002
.args = args ,
1014
1003
.proc = proc ,
1015
1004
};
1016
- RB_GC_GUARD (thgroup );
1017
1005
return thread_create_core (rb_thread_alloc (rb_cThread ), & params );;
1018
1006
}
1019
1007
0 commit comments