Skip to content

Commit

Permalink
Bug 1573160 - shutdown newly-spawned threads if we're shutting down; …
Browse files Browse the repository at this point in the history
…r=mccr8 a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D41551

--HG--
extra : source : 486c1d9d10912074867ea4b255107007224bedf7
extra : intermediate-source : cbf4da0320f6095e61813fa1eafd1b46fdd4716d
  • Loading branch information
froydnj committed Aug 15, 2019
1 parent a5b05cf commit a95643c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xpcom/threads/nsThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ nsresult nsThreadPool::PutEvent(already_AddRefed<nsIRunnable> aEvent,
bool killThread = false;
{
MutexAutoLock lock(mMutex);
if (mThreads.Count() < (int32_t)mThreadLimit) {
if (mShutdown) {
killThread = true;
} else if (mThreads.Count() < (int32_t)mThreadLimit) {
mThreads.AppendObject(thread);
} else {
killThread = true; // okay, we don't need this thread anymore
Expand Down

0 comments on commit a95643c

Please sign in to comment.