diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index 6631c41c7..afc62b2f7 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -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 diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx index a1d7be855..864215995 100644 --- a/src/event/Loop.hxx +++ b/src/event/Loop.hxx @@ -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; /**