event/Loop: un-inline AddFD(), ModifyFD()
Prepare for adding more code here.
This commit is contained in:
parent
7d502fb448
commit
dd94f97572
@ -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
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user