event/Loop: pass SocketEvent& to AbandonFD()
This commit is contained in:
parent
46418d0f2d
commit
65a1c4a016
|
@ -103,13 +103,14 @@ EventLoop::Break() noexcept
|
|||
}
|
||||
|
||||
bool
|
||||
EventLoop::AbandonFD(int _fd) noexcept
|
||||
EventLoop::AbandonFD(SocketEvent &event) noexcept
|
||||
{
|
||||
#ifdef HAVE_THREADED_EVENT_LOOP
|
||||
assert(!IsAlive() || IsInside());
|
||||
#endif
|
||||
assert(event.IsDefined());
|
||||
|
||||
return poll_backend.Abandon(_fd);
|
||||
return poll_backend.Abandon(event.GetSocket().Get());
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -196,7 +196,7 @@ public:
|
|||
* has been closed. This is like RemoveFD(), but does not
|
||||
* attempt to use #EPOLL_CTL_DEL.
|
||||
*/
|
||||
bool AbandonFD(int fd) noexcept;
|
||||
bool AbandonFD(SocketEvent &event) noexcept;
|
||||
|
||||
void AddIdle(IdleEvent &i) noexcept;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ SocketEvent::Close() noexcept
|
|||
return;
|
||||
|
||||
if (std::exchange(scheduled_flags, 0) != 0)
|
||||
loop.AbandonFD(fd.Get());
|
||||
loop.AbandonFD(*this);
|
||||
fd.Close();
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ void
|
|||
SocketEvent::Abandon() noexcept
|
||||
{
|
||||
if (std::exchange(scheduled_flags, 0) != 0)
|
||||
loop.AbandonFD(fd.Get());
|
||||
loop.AbandonFD(*this);
|
||||
|
||||
fd = SocketDescriptor::Undefined();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue