diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-09-06 10:29:38 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-09-06 10:29:38 +0200 |
commit | 9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7 (patch) | |
tree | 0f3678a1ed688c2f430b1cae5859916790908ac6 /xpcom/threads/nsThreadPool.cpp | |
parent | ab6242a93b849b0a3c7525b16bc01dd3172fc167 (diff) | |
parent | 6db06749e2037029adc96660aafa5339ed609e60 (diff) | |
download | UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar.gz UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar.lz UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar.xz UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.zip |
Merge branch 'master' into release
Diffstat (limited to 'xpcom/threads/nsThreadPool.cpp')
-rw-r--r-- | xpcom/threads/nsThreadPool.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index 241fad39d..eb967870a 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -112,7 +112,9 @@ nsThreadPool::PutEvent(already_AddRefed<nsIRunnable> aEvent, uint32_t aFlags) bool killThread = false; { MutexAutoLock lock(mMutex); - if (mThreads.Count() < (int32_t)mThreadLimit) { + if (mShutdown) { + killThread = true; // we're in shutdown, kill the thread + } else if (mThreads.Count() < (int32_t)mThreadLimit) { mThreads.AppendObject(thread); } else { killThread = true; // okay, we don't need this thread anymore |