From 456a54de69ee963e0418684f9188ff1aa73ddc94 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Tue, 23 Oct 2018 13:05:29 +0000 Subject: [PATCH] mjit_worker.c: don't ask MJIT copy job to main thread when main thread is waiting for MJIT worker forever without executing RUBY_VM_CHECK_INTS due to --jit-wait. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit_worker.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mjit_worker.c b/mjit_worker.c index 41d07f0dd7..18957cf373 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -1241,8 +1241,12 @@ mjit_worker(void) /* Copy ISeq's inline caches values to avoid race condition. */ if (job.cc_entries != NULL || job.is_entries != NULL) { - if (copy_cache_from_main_thread(&job) == FALSE) + if (UNLIKELY(mjit_opts.wait)) { + mjit_copy_job_handler((void *)&job); /* main thread is waiting in mjit_wait_call() and doesn't race */ + } + else if (copy_cache_from_main_thread(&job) == FALSE) { continue; /* retry postponed_job failure, or stop worker */ + } } /* JIT compile */