Skip to content

Commit

Permalink
aio: clarify self.ops difference in fallback
Browse files Browse the repository at this point in the history
In io_uring, we have to keep track of the pending operations that have
not yet been completed, but in Fallback that's not the case.
  • Loading branch information
Cloudef committed Jun 28, 2024
1 parent 350564e commit 8ea2d5b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/aio/Fallback.zig
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ fn start(self: *@This(), id: u16) !void {
}

fn submit(self: *@This()) !bool {
// unlike io_uring, this is not only submitted ops, but also pending ops
if (self.ops.empty()) return false;
defer self.prev_id = null;
self.pfd.add(.{ .fd = self.source.fd, .events = std.posix.POLL.IN, .revents = 0 }) catch unreachable;
Expand Down

0 comments on commit 8ea2d5b

Please sign in to comment.