diff options
author | Eric Wong <e@80x24.org> | 2019-06-27 21:21:05 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-29 19:59:00 +0000 |
commit | e37ac4015fa6f9616c845a73abc36ec5a21d57a7 (patch) | |
tree | 8a2b49d031e5da3e47c96141a12392a69d484b1b /lib/PublicInbox/DSKQXS.pm | |
parent | 63eeb22554eb844cee274f71d3541446c28b328f (diff) | |
download | public-inbox-e37ac4015fa6f9616c845a73abc36ec5a21d57a7.tar.gz |
We don't need extra wakeups from the kernel when we know a listener is already active.
Diffstat (limited to 'lib/PublicInbox/DSKQXS.pm')
-rw-r--r-- | lib/PublicInbox/DSKQXS.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/DSKQXS.pm b/lib/PublicInbox/DSKQXS.pm index 364df3d6..278d3f88 100644 --- a/lib/PublicInbox/DSKQXS.pm +++ b/lib/PublicInbox/DSKQXS.pm @@ -16,7 +16,8 @@ use warnings; use parent qw(IO::KQueue); use parent qw(Exporter); use IO::KQueue; -use PublicInbox::Syscall qw(EPOLLONESHOT EPOLLIN EPOLLOUT EPOLL_CTL_DEL); +use PublicInbox::Syscall qw(EPOLLONESHOT EPOLLIN EPOLLOUT EPOLLET + EPOLL_CTL_DEL); our @EXPORT_OK = qw(epoll_ctl epoll_wait); my $owner_pid = -1; # kqueue is close-on-fork (yes, fork, not exec) @@ -25,6 +26,7 @@ sub kq_flag ($$) { my ($bit, $ev) = @_; if ($ev & $bit) { my $fl = EV_ADD | EV_ENABLE; + $fl |= EV_CLEAR if $fl & EPOLLET; ($ev & EPOLLONESHOT) ? ($fl | EV_ONESHOT) : $fl; } else { EV_ADD | EV_DISABLE; |