ruby-changes:71682
From: Koichi <ko1@a...>
Date: Fri, 8 Apr 2022 13:31:47 +0900 (JST)
Subject: [ruby-changes:71682] 798e21637f (master): sync `vm->constant_cache`
https://git.ruby-lang.org/ruby.git/commit/?id=798e21637f From 798e21637f28d308bf0d52081fedd1a49cd1f851 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Fri, 8 Apr 2022 12:29:02 +0900 Subject: sync `vm->constant_cache` On multi-ractors, `vm->constant_cache` (and so on) can be accessed in parallel so we need to synchronize the accesses to them. http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20220407T213003Z.log.html.gz#btest --- vm_insnhelper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vm_insnhelper.c b/vm_insnhelper.c index f56e01d7f7..87aaeefa7e 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -4963,7 +4963,12 @@ static void https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L4963 vm_ic_compile(rb_control_frame_t *cfp, IC ic) { const rb_iseq_t *iseq = cfp->iseq; - rb_iseq_each(iseq, cfp->pc - ISEQ_BODY(iseq)->iseq_encoded, vm_ic_compile_i, (void *) ic); + + RB_VM_LOCK_ENTER(); + { + rb_iseq_each(iseq, cfp->pc - ISEQ_BODY(iseq)->iseq_encoded, vm_ic_compile_i, (void *) ic); + } + RB_VM_LOCK_LEAVE(); } // For MJIT inlining -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/