mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Clean up Ractor cache after fork
Ractors created in a parent process should be properly shut down in the child process. They need their cache cleared and status set to "terminated" Co-authored-by: John Hawthorn <john@hawthorn.email>
This commit is contained in:
parent
d7ad53f249
commit
f7ff380998
Notes:
git
2025-05-08 17:53:42 +00:00
4 changed files with 21 additions and 0 deletions
3
thread.c
3
thread.c
|
@ -4740,6 +4740,9 @@ rb_thread_atfork_internal(rb_thread_t *th, void (*atfork)(rb_thread_t *, const r
|
|||
|
||||
// OK. Only this thread accesses:
|
||||
ccan_list_for_each(&vm->ractor.set, r, vmlr_node) {
|
||||
if (r != vm->ractor.main_ractor) {
|
||||
rb_ractor_terminate_atfork(vm, r);
|
||||
}
|
||||
ccan_list_for_each(&r->threads.set, i, lt_node) {
|
||||
atfork(i, th);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue