From 8849b9b62c40c92a3d89135dccd53d275e1ebfd9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Oct 2020 16:59:27 +0200 Subject: [PATCH] event/SocketEvent: move Abandon() up --- src/event/SocketEvent.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 {