From c5e8a49bdeadd8e424274c17c0d2a9ffed64417b Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 10 Jun 2021 00:32:15 -0700 Subject: 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. --- mjit_worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mjit_worker.c') 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); -- cgit v1.2.3