summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
authorAaron Patterson <[email protected]>2025-03-25 15:55:33 -0700
committerJohn Hawthorn <[email protected]>2025-05-08 10:53:28 -0700
commite3452cfad26edcb3ba6e9bf818f7d02838cf676f (patch)
treebfff3c6d1bfcaaa742410aa1f00e5027e21ca8e7 /ractor.c
parentf7ff380998888f5bdcd6fccda472fdd3e5f40470 (diff)
Raise error on take/send for Ractors in child processes
Ractor objects that are available in a child process should raise a `Ractor::ClosedError` exception when called with `send` or `take` Co-authored-by: John Hawthorn <[email protected]>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12982
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ractor.c b/ractor.c
index c536d27e4e..c6095c8863 100644
--- a/ractor.c
+++ b/ractor.c
@@ -2096,6 +2096,9 @@ rb_ractor_terminate_atfork(rb_vm_t *vm, rb_ractor_t *r)
rb_gc_ractor_cache_free(r->newobj_cache);
r->newobj_cache = NULL;
r->status_ = ractor_terminated;
+ r->sync.outgoing_port_closed = true;
+ r->sync.incoming_port_closed = true;
+ r->sync.will_basket.type.e = basket_type_none;
}
#endif