Skip to content

Commit 62a23d5

Browse files
casperisfinebyroot
andauthored
Trigger write barriers when setting IO_Event_Selector_EPoll_Descriptor.io (#118)
Fix: #113 (comment) Co-authored-by: Jean Boussier <[email protected]>
1 parent bb032b0 commit 62a23d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/io/event/selector/epoll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ int IO_Event_Selector_EPoll_Descriptor_update(struct IO_Event_Selector_EPoll *se
241241
} else {
242242
// The IO has changed, we need to reset the state:
243243
epoll_descriptor->registered_events = 0;
244-
epoll_descriptor->io = io;
244+
RB_OBJ_WRITE(selector->backend.self, &epoll_descriptor->io, io);
245245
}
246246

247247
if (epoll_descriptor->waiting_events == 0) {
@@ -251,7 +251,7 @@ int IO_Event_Selector_EPoll_Descriptor_update(struct IO_Event_Selector_EPoll *se
251251
epoll_descriptor->registered_events = 0;
252252
}
253253

254-
epoll_descriptor->io = 0;
254+
RB_OBJ_WRITE(selector->backend.self, &epoll_descriptor->io, 0);
255255

256256
return 0;
257257
}

0 commit comments

Comments
 (0)