event/Loop: add assertions

This commit is contained in:
Max Kellermann 2020-10-18 20:04:15 +02:00
parent e3270dfd68
commit 8bab5733d7

View File

@ -118,6 +118,7 @@ EventLoop::AddFD(int fd, unsigned events, SocketEvent &event) noexcept
#ifdef HAVE_THREADED_EVENT_LOOP
assert(!IsAlive() || IsInside());
#endif
assert(events != 0);
if (!poll_group.Add(fd, events, &event))
return false;
@ -132,6 +133,7 @@ EventLoop::ModifyFD(int fd, unsigned events, SocketEvent &event) noexcept
#ifdef HAVE_THREADED_EVENT_LOOP
assert(!IsAlive() || IsInside());
#endif
assert(events != 0);
return poll_group.Modify(fd, events, &event);
}