aboutsummaryrefslogtreecommitdiffstats
path: root/mjit_worker.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2021-06-10 00:32:15 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2021-06-10 00:32:24 -0700
commitc5e8a49bdeadd8e424274c17c0d2a9ffed64417b (patch)
treef8f95bac341505213430cd2b61a846dc7cee089f /mjit_worker.c
parent791d7d49476e6363c1bd24af637a9581acc627bb (diff)
downloadruby-c5e8a49bdeadd8e424274c17c0d2a9ffed64417b.tar.gz
Avoid enqueueing the same ISeq twice
by a race condition by multiple Ractors. Atmically incrementing body->total_calls may have its own cost, so for now we intentionally leave the unreliable total_calls. So we allow an ISeq to be never pushed when you use multiple Ractors. However, if you enqueue a single ccan node twice, get_from_list loops infinitely. Thus this patch takes care of such a situation.
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index bfcf8c0f69..046d3a9faf 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1106,7 +1106,7 @@ load_func_from_so(const char *so_file, const char *funcname, struct rb_mjit_unit
handle = dlopen(so_file, RTLD_NOW);
if (handle == NULL) {
mjit_warning("failure in loading code from '%s': %s", so_file, dlerror());
- return (void *)NOT_ADDED_JIT_ISEQ_FUNC;
+ return (void *)NOT_COMPILED_JIT_ISEQ_FUNC;
}
func = dlsym(handle, funcname);