From 16b1fa65033663d4c1652446c07512ebd0b0676f Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 22 Oct 2024 12:03:59 +1300 Subject: [PATCH] Add write barriers to `IO_Event_Selector_resume/_raise`. (#124) --- ext/io/event/selector/selector.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/io/event/selector/selector.c b/ext/io/event/selector/selector.c index fc49332..03102c9 100644 --- a/ext/io/event/selector/selector.c +++ b/ext/io/event/selector/selector.c @@ -233,6 +233,8 @@ VALUE IO_Event_Selector_resume(struct IO_Event_Selector *backend, int argc, VALU .fiber = rb_fiber_current() }; + RB_OBJ_WRITTEN(backend->self, Qundef, waiting.fiber); + queue_push(backend, &waiting); struct wait_and_transfer_arguments arguments = { @@ -266,6 +268,8 @@ VALUE IO_Event_Selector_raise(struct IO_Event_Selector *backend, int argc, VALUE .fiber = rb_fiber_current() }; + RB_OBJ_WRITTEN(backend->self, Qundef, waiting.fiber); + queue_push(backend, &waiting); struct wait_and_transfer_arguments arguments = {