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
|
bool
|
||||||
EventLoop::RemoveFD(int _fd) noexcept
|
EventLoop::AddFD(int fd, unsigned events, SocketEvent &event) noexcept
|
||||||
{
|
{
|
||||||
#ifdef HAVE_THREADED_EVENT_LOOP
|
#ifdef HAVE_THREADED_EVENT_LOOP
|
||||||
assert(!IsAlive() || IsInside());
|
assert(!IsAlive() || IsInside());
|
||||||
#endif
|
#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
|
void
|
||||||
|
@ -186,22 +186,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Break() noexcept;
|
void Break() noexcept;
|
||||||
|
|
||||||
bool AddFD(int _fd, unsigned flags, SocketEvent &m) noexcept {
|
bool AddFD(int fd, unsigned events, SocketEvent &event) noexcept;
|
||||||
#ifdef HAVE_THREADED_EVENT_LOOP
|
bool ModifyFD(int fd, unsigned events, SocketEvent &event) noexcept;
|
||||||
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 RemoveFD(int fd) noexcept;
|
bool RemoveFD(int fd) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user