Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2019-09-06 23:57:22 +08:00
commit 6d191b58d4
64 changed files with 532 additions and 20498 deletions

View file

@ -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