event/SocketEvent: move Abandon() up

This commit is contained in:
Max Kellermann 2020-10-15 16:59:27 +02:00
parent caa2611ad5
commit 8849b9b62c

View File

@ -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
{