Commit fa572870 authored by Alex Hultman's avatar Alex Hultman
Browse files

Epoll: Timers should not tick while in a poll callback

parent 32484512
......@@ -21,13 +21,13 @@ void Loop::run() {
closing.clear();
int numFdReady = epoll_wait(epfd, readyEvents, 1024, delay);
timepoint = std::chrono::system_clock::now();
for (int i = 0; i < numFdReady; i++) {
Poll *poll = (Poll *) readyEvents[i].data.ptr;
int status = -bool(readyEvents[i].events & EPOLLERR);
callbacks[poll->state.cbIndex](poll, status, readyEvents[i].events);
}
timepoint = std::chrono::system_clock::now();
while (timers.size() && timers[0].timepoint < timepoint) {
Timer *timer = timers[0].timer;
cancelledLastTimer = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment