mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
Don't free Ractors in GC shutdown
rb_gc_shutdown_call_finalizer_p returns false for threads and fibers, so it should probably do the same for all Ractors (not just the main one). This hopefully mitigates a bug where, at exit, rb_ractor_terminate_all gets all Ractors to stop before continuing with the shutdown process. However when vm->ractor.cnt reaches 1, the native threads may still be running code at the end co_start, which reads/locks on th->ractor->threads.sched, so the Ractor is not safe to free. A better solution might be to ensure that all native threads end up stopped or otherwise parked before this part of the shutdown, however that would be a bit more involved.
This commit is contained in:
parent
88906e13e6
commit
149add89e3
2
gc.c
2
gc.c
@ -343,7 +343,7 @@ rb_gc_shutdown_call_finalizer_p(VALUE obj)
|
||||
if (rb_obj_is_thread(obj)) return false;
|
||||
if (rb_obj_is_mutex(obj)) return false;
|
||||
if (rb_obj_is_fiber(obj)) return false;
|
||||
if (rb_obj_is_main_ractor(obj)) return false;
|
||||
if (rb_ractor_p(obj)) return false;
|
||||
if (rb_obj_is_fstring_table(obj)) return false;
|
||||
if (rb_obj_is_symbol_table(obj)) return false;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user