diff --git a/mjit.c b/mjit.c index 25b2bd9322..1578c961ae 100644 --- a/mjit.c +++ b/mjit.c @@ -681,10 +681,10 @@ stop_worker(void) { rb_execution_context_t *ec = GET_EC(); - stop_worker_p = TRUE; while (!worker_stopped) { verbose(3, "Sending cancel signal to worker"); CRITICAL_SECTION_START(3, "in stop_worker"); + stop_worker_p = TRUE; /* Setting this inside loop because RUBY_VM_CHECK_INTS may make this FALSE. */ rb_native_cond_broadcast(&mjit_worker_wakeup); CRITICAL_SECTION_FINISH(3, "in stop_worker"); RUBY_VM_CHECK_INTS(ec);