diff options
author | Takashi Kokubun <[email protected]> | 2021-06-02 23:55:23 -0700 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2021-06-02 23:59:33 -0700 |
commit | 7e14762159643b4415e094f9d2a90afaf7994588 (patch) | |
tree | eb6eac2d307da6c06407ca1dcb3f32258f69d1d9 /mjit_worker.c | |
parent | 9f3888d6a3387773c8707b7971ce64c60df33d36 (diff) |
Do not doubly hold an MJIT lock
This is a follow-up of 86c262541ad07528842d76dab4b9b34bd888d5f4.
CRITICAL_SECTION_START/FINISH are not needed when it's called from an
MJIT worker.
Also, ZALLOC needs to be calloc because ZALLOC may trigger GC, which an
MJIT worker must not do.
Diffstat (limited to 'mjit_worker.c')
-rw-r--r-- | mjit_worker.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mjit_worker.c b/mjit_worker.c index 50f1b0787e..2e87b1c97c 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -1396,7 +1396,7 @@ unload_units(void) } } -static void mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_info *compile_info); +static void mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_info *compile_info, bool worker_p); // The function implementing a worker. It is executed in a separate // thread by rb_thread_create_mjit_thread. It compiles precompiled header @@ -1448,7 +1448,7 @@ mjit_worker(void) remove_from_list(unit, &active_units); add_to_list(unit, &stale_units); // Lazily put it to unit_queue as well to avoid race conditions on jit_unit with mjit_compile. - mjit_add_iseq_to_process(unit->iseq, &unit->iseq->body->jit_unit->compile_info); + mjit_add_iseq_to_process(unit->iseq, &unit->iseq->body->jit_unit->compile_info, true); } } } |