mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-24 05:13:07 +09:00
Kill newly-spawned threads if we're shutting down.
This commit is contained in:
parent
26b079c59f
commit
f40a82f098
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue