Commit 8849b9b6 authored by Max Kellermann's avatar Max Kellermann

event/SocketEvent: move Abandon() up

parent caa2611a
......@@ -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
{
......@@ -86,15 +95,6 @@ SocketEvent::Schedule(unsigned flags) noexcept
}
void
SocketEvent::Abandon() noexcept
{
if (std::exchange(scheduled_flags, 0) != 0)
loop.AbandonFD(fd.Get());
fd = SocketDescriptor::Undefined();
}
void
SocketEvent::Dispatch() noexcept
{
const unsigned flags = std::exchange(ready_flags, 0) &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment