From 137f84bdf79b13ead099178ddc94480ea6dfb963 Mon Sep 17 00:00:00 2001 From: vadik likholetov Date: Thu, 9 Jul 2026 14:31:39 +0300 Subject: [PATCH] utils/eventfd: honor EFD_NONBLOCK as a bitflag on macOS `EventFd::new(EFD_NONBLOCK | EFD_SEMAPHORE)` left the pipe blocking, since the flag was compared for equality. `pollable_channel` passes exactly that combination, so its `try_recv()` would block on an empty pipe while holding the queue mutex. Signed-off-by: vadik likholetov --- src/utils/src/macos/eventfd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/src/macos/eventfd.rs b/src/utils/src/macos/eventfd.rs index d31f0cc..0ead6eb 100644 --- a/src/utils/src/macos/eventfd.rs +++ b/src/utils/src/macos/eventfd.rs @@ -38,7 +38,7 @@ impl EventFd { pub fn new(flag: i32) -> result::Result { let (read_fd, write_fd) = pipe()?; - if flag == EFD_NONBLOCK { + if flag & EFD_NONBLOCK != 0 { set_nonblock(&read_fd)?; set_nonblock(&write_fd)?; } -- 2.51.2