event/Loop: un-inline AddFD(), ModifyFD()

Prepare for adding more code here.
This commit is contained in:
Max Kellermann 2020-10-18 19:43:35 +02:00
parent 7d502fb448
commit dd94f97572
2 changed files with 24 additions and 18 deletions

View File

@ -111,13 +111,33 @@ EventLoop::AbandonFD(int _fd) noexcept
}
bool
EventLoop::RemoveFD(int _fd) noexcept
EventLoop::AddFD(int fd, unsigned events, SocketEvent &event) noexcept
{
#ifdef HAVE_THREADED_EVENT_LOOP
assert(!IsAlive() || IsInside());
#endif
return poll_group.Remove(_fd);
return poll_group.Add(fd, events, &event);
}
bool
EventLoop::ModifyFD(int fd, unsigned events, SocketEvent &event) noexcept
{
#ifdef HAVE_THREADED_EVENT_LOOP
assert(!IsAlive() || IsInside());
#endif
return poll_group.Modify(fd, events, &event);
}
bool
EventLoop::RemoveFD(int fd) noexcept
{
#ifdef HAVE_THREADED_EVENT_LOOP
assert(!IsAlive() || IsInside());
#endif
return poll_group.Remove(fd);
}
void

View File

@ -186,22 +186,8 @@ public:
*/
void Break() noexcept;
bool AddFD(int _fd, unsigned flags, SocketEvent &m) noexcept {
#ifdef HAVE_THREADED_EVENT_LOOP
assert(!IsAlive() || IsInside());
#endif
return poll_group.Add(_fd, flags, &m);
}
bool ModifyFD(int _fd, unsigned flags, SocketEvent &m) noexcept {
#ifdef HAVE_THREADED_EVENT_LOOP
assert(!IsAlive() || IsInside());
#endif
return poll_group.Modify(_fd, flags, &m);
}
bool AddFD(int fd, unsigned events, SocketEvent &event) noexcept;
bool ModifyFD(int fd, unsigned events, SocketEvent &event) noexcept;
bool RemoveFD(int fd) noexcept;
/**