EventManager: handle forced events even when poll return -1
This commit is contained in:
parent
b199cfd644
commit
031ed91ea6
|
@ -35,15 +35,13 @@ void EventManager::handle_next_events()
|
||||||
{
|
{
|
||||||
const int timeout_ms = 100;
|
const int timeout_ms = 100;
|
||||||
int res = poll(m_events.data(), m_events.size(), timeout_ms);
|
int res = poll(m_events.data(), m_events.size(), timeout_ms);
|
||||||
if (res >= 0)
|
for (size_t i = 0; i < m_events.size(); ++i)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < m_events.size(); ++i)
|
if ((res > 0 and m_events[i].revents) or
|
||||||
{
|
contains(m_forced, m_events[i].fd))
|
||||||
if (m_events[i].revents or contains(m_forced, m_events[i].fd))
|
m_handlers[i](m_events[i].fd);
|
||||||
m_handlers[i](m_events[i].fd);
|
|
||||||
}
|
|
||||||
m_forced.clear();
|
|
||||||
}
|
}
|
||||||
|
m_forced.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventManager::force_signal(int fd)
|
void EventManager::force_signal(int fd)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user