Pārlūkot izejas kodu

Run timeouts that will expire in less than one millisecond.

The timeouts for poll and epoll are given in milliseconds,
which caused busy looping in the event loop for timeouts
with less time remaining.
master
Richard Nyberg pirms 16 gadiem
vecāks
revīzija
4539bc6fae
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. +1
    -1
      evloop/timer.c

+ 1
- 1
evloop/timer.c Parādīt failu

@@ -106,7 +106,7 @@ evtimers_run(void)
evtimer_gettime(&now);
while (timeheap_size() > 0) {
struct timespec diff = subtime(timeheap_top(), now);
if (diff.tv_sec < 0) {
if (diff.tv_sec < 0 || (diff.tv_sec == 0 && diff.tv_nsec < 1000000)) {
struct timeout *t = timeheap_remove_top();
t->th.i = -1;
t->cb(-1, EV_TIMEOUT, t->arg);


Notiek ielāde…
Atcelt
Saglabāt