diff options
author | Takashi Kokubun <[email protected]> | 2022-12-23 15:56:05 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-05 22:11:20 -0800 |
commit | 783f730773b50a18be5abd2766ff64d4cb917136 (patch) | |
tree | a647f03e5d008f16120b49f45e31e4e475af5d9d | |
parent | 23a58105eeff3c0a4ba34d51c822c6d10e95c24b (diff) |
Lock VM during compilation
-rw-r--r-- | mjit.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -380,6 +380,8 @@ uint8_t *rb_mjit_mem_block = NULL; void rb_mjit_compile(const rb_iseq_t *iseq) { + RB_VM_LOCK_ENTER(); + rb_vm_barrier(); bool original_call_p = mjit_call_p; mjit_call_p = false; // Avoid impacting JIT metrics by itself @@ -387,6 +389,7 @@ rb_mjit_compile(const rb_iseq_t *iseq) rb_funcall(rb_MJITCompiler, rb_intern("call"), 1, iseq_ptr); mjit_call_p = original_call_p; + RB_VM_LOCK_LEAVE(); } void |