From 122f4715316409015fd7a7f0b551a64ccaf005d4 Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Wed, 22 Sep 2004 02:37:49 +0000 Subject: [PATCH] Retract last change, it's wrong -- thanks again to lcook@sybase.com. --- xpcom/threads/TimerThread.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index 1a97fe233292..9407689229ec 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/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; }