diff --git a/src/event/SocketEvent.cxx b/src/event/SocketEvent.cxx index e1d39747a..b506e1e13 100644 --- a/src/event/SocketEvent.cxx +++ b/src/event/SocketEvent.cxx @@ -48,6 +48,15 @@ SocketEvent::Close() noexcept fd.Close(); } +void +SocketEvent::Abandon() noexcept +{ + if (std::exchange(scheduled_flags, 0) != 0) + loop.AbandonFD(fd.Get()); + + fd = SocketDescriptor::Undefined(); +} + bool SocketEvent::Schedule(unsigned flags) noexcept { @@ -85,15 +94,6 @@ SocketEvent::Schedule(unsigned flags) noexcept return success; } -void -SocketEvent::Abandon() noexcept -{ - if (std::exchange(scheduled_flags, 0) != 0) - loop.AbandonFD(fd.Get()); - - fd = SocketDescriptor::Undefined(); -} - void SocketEvent::Dispatch() noexcept {