Sort epoll_wait() output earlier
This commit is contained in:
parent
50e27cf3d8
commit
89edba14f0
6
utils.c
6
utils.c
|
@ -1223,12 +1223,12 @@ poller_run (struct poller *self)
|
||||||
self->dispatch_next = 0;
|
self->dispatch_next = 0;
|
||||||
self->dispatch_total = n_fds;
|
self->dispatch_total = n_fds;
|
||||||
|
|
||||||
poller_timers_dispatch (&self->timers);
|
|
||||||
poller_idle_dispatch (self->idle);
|
|
||||||
|
|
||||||
// Sort them by file descriptor number for binary search
|
// Sort them by file descriptor number for binary search
|
||||||
qsort (self->revents, n_fds, sizeof *self->revents, poller_compare_fds);
|
qsort (self->revents, n_fds, sizeof *self->revents, poller_compare_fds);
|
||||||
|
|
||||||
|
poller_timers_dispatch (&self->timers);
|
||||||
|
poller_idle_dispatch (self->idle);
|
||||||
|
|
||||||
while (self->dispatch_next < self->dispatch_total)
|
while (self->dispatch_next < self->dispatch_total)
|
||||||
{
|
{
|
||||||
struct epoll_event *revents = self->revents + self->dispatch_next;
|
struct epoll_event *revents = self->revents + self->dispatch_next;
|
||||||
|
|
Loading…
Reference in New Issue