From f41dc46f6213661ba51443d6cb0d6a9ba4d41472 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 24 Jun 2019 02:52:18 +0000 Subject: ds: set event flags directly at initialization We can avoid the EPOLL_CTL_ADD && EPOLL_CTL_MOD sequence with a single EPOLL_CTL_ADD. --- lib/PublicInbox/Listener.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Listener.pm') diff --git a/lib/PublicInbox/Listener.pm b/lib/PublicInbox/Listener.pm index 6ee3abb1..94b2aed4 100644 --- a/lib/PublicInbox/Listener.pm +++ b/lib/PublicInbox/Listener.pm @@ -17,8 +17,8 @@ sub new ($$$) { listen($s, 1024); IO::Handle::blocking($s, 0); my $self = fields::new($class); - $self->SUPER::new($s, 1); # calls epoll_create for the first socket - $self->watch_read(1); + $self->SUPER::new($s, PublicInbox::DS::EPOLLIN()| + PublicInbox::DS::EPOLLEXCLUSIVE()); $self->{post_accept} = $cb; $self } -- cgit v1.2.3-24-ge0c7