diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-03-28 17:38:06 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-03-29 14:53:49 -0400 |
commit | cdededf24dff06842fe8401af93cf6d8c304de13 (patch) | |
tree | 37a9526c37d9d0a8b764adbe79037ccf7f523d2b | |
parent | 93b6997103b34750b2d84df07e09586fe1de0649 (diff) | |
download | ruby-cdededf24dff06842fe8401af93cf6d8c304de13.tar.gz |
YJIT: Take VM lock in RubyVM::YJIT.code_gc
Code GC needs synchronization.
-rw-r--r-- | yjit/src/yjit.rs | 9 |
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 } |