From cea8db7eaa35657fe594377ff30ae1e028329b2d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 4 Dec 2020 09:55:01 +0100 Subject: [PATCH] event/SocketEvent: add comment --- src/event/SocketEvent.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/event/SocketEvent.cxx b/src/event/SocketEvent.cxx index ad2aa576a..23ab50f2a 100644 --- a/src/event/SocketEvent.cxx +++ b/src/event/SocketEvent.cxx @@ -44,6 +44,9 @@ SocketEvent::Close() noexcept if (!fd.IsDefined()) return; + /* closing the socket automatically unregisters it from epoll, + so we can omit the epoll_ctl(EPOLL_CTL_DEL) call and save + one system call */ if (std::exchange(scheduled_flags, 0) != 0) loop.AbandonFD(*this); fd.Close();