sync rb_gc_register_mark_object()

rb_vm_t::mark_object_ary is global resource so we need to
synchronize to access it.
This commit is contained in:
Koichi Sasada 2020-09-24 17:06:33 +09:00
parent e06f4a3b1f
commit 4a588e70b8

4
gc.c
View File

@ -7347,6 +7347,8 @@ rb_gc_force_recycle(VALUE obj)
void
rb_gc_register_mark_object(VALUE obj)
{
RB_VM_LOCK_ENTER();
{
VALUE ary_ary = GET_VM()->mark_object_ary;
VALUE ary = rb_ary_last(0, 0, ary_ary);
@ -7356,6 +7358,8 @@ rb_gc_register_mark_object(VALUE obj)
}
rb_ary_push(ary, obj);
}
RB_VM_LOCK_LEAVE();
}
void