diff options
author | Koichi Sasada <[email protected]> | 2024-07-03 11:56:49 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2024-07-05 21:20:54 +0900 |
commit | 685a4e5be77ec376f29a180c7ed9fbee23e05bac (patch) | |
tree | 583720f6654720dc5bdeeeebf6ded38bb13aa497 /thread_pthread.c | |
parent | 88a2a46e233fb52107f4ef921813f14243af75d4 (diff) |
VM barrier needs to store GC root
On the VM barrier waiting, it needs to store machine context
as a GC root.
Also it needs to wait for barrier synchronization correctly
by `while` (for continuous barrier sync by another ractor).
This is why GC marking misses are occerred on ARM machines.
like: https://rubyci.s3.amazonaws.com/fedora40-arm/ruby-master/log/20240702T063002Z.fail.html.gz
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index b9421559f2..1046a8aabe 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -592,7 +592,7 @@ thread_sched_setup_running_threads(struct rb_thread_sched *sched, rb_ractor_t *c } if (add_th) { - if (UNLIKELY(vm->ractor.sched.barrier_waiting)) { + while (UNLIKELY(vm->ractor.sched.barrier_waiting)) { RUBY_DEBUG_LOG("barrier-wait"); ractor_sched_barrier_join_signal_locked(vm); @@ -605,6 +605,7 @@ thread_sched_setup_running_threads(struct rb_thread_sched *sched, rb_ractor_t *c ccan_list_add(&vm->ractor.sched.running_threads, &add_th->sched.node.running_threads); vm->ractor.sched.running_cnt++; sched->is_running = true; + VM_ASSERT(!vm->ractor.sched.barrier_waiting); } if (add_timeslice_th) { |