Skip to content

Commit 0a1d278

Browse files
Revert "Re-submit wakeup read immediately on completion (simulated multi-shot)."
This reverts commit cfda109.
1 parent cfda109 commit 0a1d278

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

ext/io/event/selector/uring.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,19 +1175,12 @@ unsigned select_process_completions(struct IO_Event_Selector_URing *selector) {
11751175
continue;
11761176
}
11771177

1178-
// Wakeup eventfd read completion — the read already consumed the counter.
1179-
// Immediately re-submit a new read so one is always pending (simulating
1180-
// multi-shot), avoiding an extra submission on the next blocking wait.
1178+
// Wakeup eventfd read completion — the read already consumed the counter,
1179+
// no separate drain needed. Clear the flag so the next blocking wait
1180+
// re-submits the read.
11811181
if (cqe->user_data == (uint64_t)(uintptr_t)&selector->wakeup_fd) {
1182+
selector->wakeup_registered = 0;
11821183
io_uring_cq_advance(ring, 1);
1183-
struct io_uring_sqe *wakeup_sqe = io_uring_get_sqe(ring);
1184-
if (wakeup_sqe) {
1185-
io_uring_prep_read(wakeup_sqe, selector->wakeup_fd, &selector->wakeup_value, sizeof(selector->wakeup_value), 0);
1186-
io_uring_sqe_set_data(wakeup_sqe, &selector->wakeup_fd);
1187-
selector->pending += 1;
1188-
} else {
1189-
selector->wakeup_registered = 0;
1190-
}
11911184
continue;
11921185
}
11931186

0 commit comments

Comments
 (0)