summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-23 13:05:29 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-23 13:05:29 (GMT)
commit456a54de69ee963e0418684f9188ff1aa73ddc94 (patch)
tree4f550c3023bc758caf1253ee56d86d182fc2e9c1 /mjit_worker.c
parent353c86eed45e873e3710f6d4afb4e6cab659147a (diff)
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
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index 41d07f0..18957cf 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 */