summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-03-28 17:38:06 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2023-03-29 14:53:49 -0400
commitcdededf24dff06842fe8401af93cf6d8c304de13 (patch)
tree37a9526c37d9d0a8b764adbe79037ccf7f523d2b /yjit/src
parent93b6997103b34750b2d84df07e09586fe1de0649 (diff)
downloadruby-cdededf24dff06842fe8401af93cf6d8c304de13.tar.gz
YJIT: Take VM lock in RubyVM::YJIT.code_gc
Code GC needs synchronization.
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/yjit.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/yjit/src/yjit.rs b/yjit/src/yjit.rs
index d75b9db0ee..3201af6982 100644
--- a/yjit/src/yjit.rs
+++ b/yjit/src/yjit.rs
@@ -139,9 +139,12 @@ pub extern "C" fn rb_yjit_code_gc(_ec: EcPtr, _ruby_self: VALUE) -> VALUE {
return Qnil;
}
- let cb = CodegenGlobals::get_inline_cb();
- let ocb = CodegenGlobals::get_outlined_cb();
- cb.code_gc(ocb);
+ with_vm_lock(src_loc!(), || {
+ let cb = CodegenGlobals::get_inline_cb();
+ let ocb = CodegenGlobals::get_outlined_cb();
+ cb.code_gc(ocb);
+ });
+
Qnil
}