Skip to content

Commit

Permalink
Add write barrier for waiting fiber.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Oct 16, 2024
1 parent d735f9f commit cec15b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/io/event/selector/epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ VALUE IO_Event_Selector_EPoll_process_wait(VALUE self, VALUE fiber, VALUE _pid,
.events = IO_EVENT_READABLE,
};

RB_OBJ_WRITTEN(selector->backend.self, Qundef, fiber);

int result = IO_Event_Selector_EPoll_Waiting_register(selector, 0, descriptor, &waiting);

if (result == -1) {
Expand Down Expand Up @@ -569,6 +571,8 @@ VALUE IO_Event_Selector_EPoll_io_wait(VALUE self, VALUE fiber, VALUE io, VALUE e
.events = RB_NUM2INT(events),
};

RB_OBJ_WRITTEN(selector->backend.self, Qundef, fiber);

int result = IO_Event_Selector_EPoll_Waiting_register(selector, io, descriptor, &waiting);

if (result == -1) {
Expand Down

0 comments on commit cec15b1

Please sign in to comment.