this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: manually reschedule to avoid hang on macOS

libxev's .rearm semantics are unfortunately not very
portable---rescheduling the exact same event on macOS / kqueue seems
to cause the event loop to hang, while manually rescheduling and
returning .disarm does not.

authored by

Rylee Lyman and committed by
Tim Culverhouse
fbaa6ca8 49cc8ae7

+21 -4
+21 -4
src/xev.zig
··· 118 118 buf: xev.ReadBuffer, 119 119 r: xev.ReadError!usize, 120 120 ) xev.CallbackAction { 121 - _ = c; // autofix 122 121 const n = r catch |err| { 123 122 log.err("read error: {}", .{err}); 124 123 return .disarm; ··· 230 229 } 231 230 } 232 231 233 - return .rearm; 232 + self.file.read( 233 + loop, 234 + c, 235 + .{ .slice = &self.read_buf }, 236 + Self, 237 + self, 238 + Self.ttyReadCallback, 239 + ); 240 + return .disarm; 234 241 } 235 242 236 243 fn winsizeCallback( 237 244 ud: ?*Self, 238 245 l: *xev.Loop, 239 - _: *xev.Completion, 246 + c: *xev.Completion, 240 247 r: xev.Async.WaitError!void, 241 248 ) xev.CallbackAction { 242 249 _ = r catch |err| { ··· 248 255 log.err("couldn't get winsize: {}", .{err}); 249 256 return .disarm; 250 257 }; 251 - return self.callback(self.ud, l, self, .{ .winsize = winsize }); 258 + const ret = self.callback(self.ud, l, self, .{ .winsize = winsize }); 259 + if (ret == .disarm) return .disarm; 260 + 261 + self.winsize_wakeup.wait( 262 + l, 263 + c, 264 + Self, 265 + self, 266 + winsizeCallback, 267 + ); 268 + return .disarm; 252 269 } 253 270 }; 254 271 }