Commit 149add8
committed
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.1 parent 88906e1 commit 149add8
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
| 346 | + | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| |||
0 commit comments