From c78c0d8b2492e625d3b52e94497ebe2763ac3d23 Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Wed, 22 Sep 2004 02:39:52 +0000 Subject: [PATCH] Retract last change, it's wrong -- thanks again to lcook@sybase.com. git-svn-id: svn://10.0.0.236/trunk@162650 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/threads/TimerThread.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/xpcom/threads/TimerThread.cpp b/mozilla/xpcom/threads/TimerThread.cpp index 1a97fe23329..9407689229e 100644 --- a/mozilla/xpcom/threads/TimerThread.cpp +++ b/mozilla/xpcom/threads/TimerThread.cpp @@ -393,7 +393,16 @@ PRInt32 TimerThread::AddTimerInternal(nsTimerImpl *aTimer) for (; i < count; i++) { nsTimerImpl *timer = NS_STATIC_CAST(nsTimerImpl *, mTimers[i]); - if (TIMER_LESS_THAN(now, timer->mTimeout + mTimeoutAdjustment) && + // Don't break till we have skipped any overdue timers. Do not include + // mTimeoutAdjustment here, because we are really trying to avoid calling + // TIMER_LESS_THAN(t, u), where the t is now + DELAY_INTERVAL_MAX, u is + // now - overdue, and DELAY_INTERVAL_MAX + overdue > DELAY_INTERVAL_LIMIT. + // In other words, we want to use now-based time, now adjusted time, even + // though "overdue" ultimately depends on adjusted time. + + // XXX does this hold for TYPE_REPEATING_PRECISE? /be + + if (TIMER_LESS_THAN(now, timer->mTimeout) && TIMER_LESS_THAN(aTimer->mTimeout, timer->mTimeout)) { break; }