ruby-changes:53087
From: k0kubun <ko1@a...>
Date: Mon, 22 Oct 2018 18:53:11 +0900 (JST)
Subject: [ruby-changes:53087] k0kubun:r65301 (trunk): mjit_worker.c: return more appropriate result
k0kubun 2018-10-22 18:53:00 +0900 (Mon, 22 Oct 2018) New Revision: 65301 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65301 Log: mjit_worker.c: return more appropriate result of copy job. When job is being stopped but job is actually finished, returning FALSE could be a little confusing from the function name. Modified files: trunk/mjit_worker.c Index: mjit_worker.c =================================================================== --- mjit_worker.c (revision 65300) +++ mjit_worker.c (revision 65301) @@ -1176,24 +1176,18 @@ static void mjit_copy_job_handler(void * https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1176 static int copy_cache_from_main_thread(struct mjit_copy_job *job) { - int success_p = TRUE; job->finish_p = FALSE; if (!rb_postponed_job_register(0, mjit_copy_job_handler, (void *)job)) return FALSE; CRITICAL_SECTION_START(3, "in MJIT copy job wait"); - while (!job->finish_p) { + while (!job->finish_p && !stop_worker_p) { rb_native_cond_wait(&mjit_worker_wakeup, &mjit_engine_mutex); verbose(3, "Getting wakeup from client"); - - if (stop_worker_p) { /* for cond broadcast from stop_worker() */ - success_p = FALSE; - break; - } } CRITICAL_SECTION_FINISH(3, "in MJIT copy job wait"); - return success_p; + return job->finish_p; } /* The function implementing a worker. It is executed in a separate -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/