summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-22 09:53:00 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-22 09:53:00 (GMT)
commitd96483de720f6a54292b15fea2458befa02a3ffa (patch)
tree8791f58b12b2938e69aa1e556ce463980a023439 /mjit_worker.c
parent89293c4ba131a763aabfdadf35ddd658503efb7c (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index 637ab1f..b25dc6f 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1176,24 +1176,18 @@ static void mjit_copy_job_handler(void *data);
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