From dd8e7742e195971b4527e52d71416037c0dc4955 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Tue, 23 Apr 2002 03:15:52 +0000 Subject: [PATCH] PAC instantiation hangs Regxpcom Solaris nightly build packaging process. Fixing timer logic. Patch by Kenneth Herron. r=dougt@netscape.com, sr=brendan@mozilla.org, b=106009 git-svn-id: svn://10.0.0.236/trunk@119597 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/threads/TimerThread.cpp | 9 ++++----- mozilla/xpcom/threads/TimerThread.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mozilla/xpcom/threads/TimerThread.cpp b/mozilla/xpcom/threads/TimerThread.cpp index d0ef5130eb6..a740b5e852a 100644 --- a/mozilla/xpcom/threads/TimerThread.cpp +++ b/mozilla/xpcom/threads/TimerThread.cpp @@ -46,7 +46,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(TimerThread, nsIRunnable) TimerThread::TimerThread() : mLock(nsnull), mCondVar(nsnull), - mProcessing(PR_FALSE), + mShutdown(PR_FALSE), mWaiting(PR_FALSE), mDelayLineCounter(0), mMinTimerPeriod(0), @@ -108,7 +108,7 @@ nsresult TimerThread::Shutdown() { // lock scope nsAutoLock lock(mLock); - mProcessing = PR_FALSE; + mShutdown = PR_TRUE; // notify the cond var so that Run() can return if (mCondVar && mWaiting) @@ -184,9 +184,8 @@ void TimerThread::UpdateFilter(PRUint32 aDelay, PRIntervalTime aTimeout, NS_IMETHODIMP TimerThread::Run() { nsAutoLock lock(mLock); - mProcessing = PR_TRUE; - while (mProcessing) { + while (!mShutdown) { PRIntervalTime now = PR_IntervalNow(); nsTimerImpl *timer = nsnull; @@ -225,7 +224,7 @@ NS_IMETHODIMP TimerThread::Run() timer = nsnull; lock.lock(); - if (!mProcessing) + if (mShutdown) break; // Update now, as PostTimerEvent plus the locking may have taken a tick or two, diff --git a/mozilla/xpcom/threads/TimerThread.h b/mozilla/xpcom/threads/TimerThread.h index 01e1e14e924..87beb727642 100644 --- a/mozilla/xpcom/threads/TimerThread.h +++ b/mozilla/xpcom/threads/TimerThread.h @@ -83,7 +83,7 @@ private: PRLock *mLock; PRCondVar *mCondVar; - PRPackedBool mProcessing; + PRPackedBool mShutdown; PRPackedBool mWaiting; nsVoidArray mTimers;