| ... | ... | @@ -163,9 +163,9 @@ pub const IO_Uring = struct { |
| 163 | 163 | /// Returns the number of SQEs submitted. |
| 164 | 164 | /// Matches the implementation of io_uring_submit_and_wait() in liburing. |
| 165 | 165 | pub fn submit_and_wait(self: *IO_Uring, wait_nr: u32) !u32 { |
| 166 | | var submitted = self.flush_sq(); |
| 166 | const submitted = self.flush_sq(); |
| 167 | 167 | var flags: u32 = 0; |
| 168 | | if (self.sq_ring_needs_enter(submitted, &flags) or wait_nr > 0) { |
| 168 | if (self.sq_ring_needs_enter(&flags) or wait_nr > 0) { |
| 169 | 169 | if (wait_nr > 0 or (self.flags & linux.IORING_SETUP_IOPOLL) != 0) { |
| 170 | 170 | flags |= linux.IORING_ENTER_GETEVENTS; |
| 171 | 171 | } |
| ... | ... | @@ -236,9 +236,9 @@ pub const IO_Uring = struct { |
| 236 | 236 | /// or if IORING_SQ_NEED_WAKEUP is set and the SQ thread must be explicitly awakened. |
| 237 | 237 | /// For the latter case, we set the SQ thread wakeup flag. |
| 238 | 238 | /// Matches the implementation of sq_ring_needs_enter() in liburing. |
| 239 | | pub fn sq_ring_needs_enter(self: *IO_Uring, submitted: u32, flags: *u32) bool { |
| 239 | pub fn sq_ring_needs_enter(self: *IO_Uring, flags: *u32) bool { |
| 240 | 240 | assert(flags.* == 0); |
| 241 | | if ((self.flags & linux.IORING_SETUP_SQPOLL) == 0 and submitted > 0) return true; |
| 241 | if ((self.flags & linux.IORING_SETUP_SQPOLL) == 0) return true; |
| 242 | 242 | if ((@atomicLoad(u32, self.sq.flags, .Unordered) & linux.IORING_SQ_NEED_WAKEUP) != 0) { |
| 243 | 243 | flags.* |= linux.IORING_ENTER_SQ_WAKEUP; |
| 244 | 244 | return true; |