summaryrefslogtreecommitdiff
path: root/xpcom/threads/nsThreadPool.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-04 13:31:30 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-04 13:31:30 +0100
commitc5c44d12073791bb1150445ce48bc57fccbb544d (patch)
tree9d7704d17cb06f886b0943d1508c9ff08f4b9570 /xpcom/threads/nsThreadPool.cpp
parenta63272b5303b7aef467e974c630f745146fb983a (diff)
parentbbc2206a0fda053a6f5071b457bd209dab9ed268 (diff)
downloaduxp-c5c44d12073791bb1150445ce48bc57fccbb544d.tar.gz
Merge branch 'master' into certexception-work
Diffstat (limited to 'xpcom/threads/nsThreadPool.cpp')
-rw-r--r--xpcom/threads/nsThreadPool.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp
index 241fad39dc..eb967870ab 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