From 20625c27b8e074a2b7577acb180cb295771a729b Mon Sep 17 00:00:00 2001 From: Marc Alexander Lehmann Date: Wed, 8 Jun 2011 13:11:55 +0000 Subject: [PATCH] *** empty log message *** --- ev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ev.c b/ev.c index 729b7a4..6792e3f 100644 --- a/ev.c +++ b/ev.c @@ -2507,14 +2507,14 @@ ev_run (EV_P_ int flags) if (timercnt) { - ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now + backend_mintime; + ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now; if (waittime > to) waittime = to; } #if EV_PERIODIC_ENABLE if (periodiccnt) { - ev_tstamp to = ANHE_at (periodics [HEAP0]) - ev_rt_now + backend_mintime; + ev_tstamp to = ANHE_at (periodics [HEAP0]) - ev_rt_now; if (waittime > to) waittime = to; } #endif @@ -2523,6 +2523,11 @@ ev_run (EV_P_ int flags) if (expect_false (waittime < timeout_blocktime)) waittime = timeout_blocktime; + /* at this point, we NEED to wait, so we have to ensure */ + /* to pass a minimum nonzero value to the backend */ + if (expect_false (waittime < backend_mintime)) + waittime = backend_mintime; + /* extra check because io_blocktime is commonly 0 */ if (expect_false (io_blocktime)) {