Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/backend/kqueue.zig
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ pub const Loop = struct {
const ecanceled = -1 * @as(i32, @intCast(@intFromEnum(posix.system.E.CANCELED)));
c.result = c.syscall_result(ecanceled);
c.flags.state = .dead;
c.next = null;
self.completions.push(c);

events[events_len] = ev;
Expand Down Expand Up @@ -261,6 +262,7 @@ pub const Loop = struct {
}

assert(c.result != null);
c.next = null;
self.completions.push(c);
}
}
Expand Down Expand Up @@ -454,7 +456,10 @@ pub const Loop = struct {
},

// Only resubmit if we aren't already active (in the queue)
.rearm => if (!c_active) self.submissions.push(c),
.rearm => if (!c_active) {
c.next = null;
self.submissions.push(c);
},
}

// If we filled the events slice, we break to avoid overflow.
Expand Down
5 changes: 4 additions & 1 deletion src/watcher/file.zig
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ fn FileStream(comptime xev: type) type {

// Rearm requeues this request, it doesn't return rearm
// on the actual callback here...
if (action == .rearm) q_inner.push(req_inner);
if (action == .rearm) {
req_inner.next = null;
q_inner.push(req_inner);
}

// If we have another request, add that completion next.
if (q_inner.head) |req_next| l_inner.add(&req_next.completion);
Expand Down
5 changes: 4 additions & 1 deletion src/watcher/stream.zig
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,10 @@ pub fn Writeable(comptime xev: type, comptime T: type, comptime options: Options

// Rearm requeues this request, it doesn't return rearm
// on the actual callback here...
if (action == .rearm) q_inner.push(req_inner);
if (action == .rearm) {
req_inner.next = null;
q_inner.push(req_inner);
}

// If we have another request, add that completion next.
if (q_inner.head) |req_next| l_inner.add(&req_next.completion);
Expand Down