Prevent epoll_wait call with a timeout if there are events in the queue to be processed

This commit is contained in:
Mark Riddoch 2014-09-25 11:10:30 +01:00
parent 63252e94f2
commit 3ac3a60229

View File

@ -423,7 +423,12 @@ DCB *zombies = NULL;
nfds,
eno)));
}
else if (nfds == 0)
/*
* If there are no new descriptors from the non-blocking call
* and nothing to proces on the event queue then for do a
* blocking call to epoll_wait.
*/
else if (nfds == 0 && process_pollq(thread_id) == 0)
{
atomic_add(&n_waiting, 1);
nfds = epoll_wait(epoll_fd,