Bug 1685727: Ensure all the thread pool task queue has been cleared before shutting down. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D102327
This commit is contained in:
Bas Schouten
2021-01-19 19:36:29 +00:00
parent cdf96be47e
commit 9af9a0caae

View File

@@ -209,10 +209,6 @@ void TaskController::RunPoolThread() {
MutexAutoLock lock(mGraphMutex);
while (true) {
if (mShuttingDown) {
IOInterposer::UnregisterCurrentThread();
return;
}
bool ranTask = false;
if (!mThreadableTasks.empty()) {
@@ -297,6 +293,12 @@ void TaskController::RunPoolThread() {
}
if (!ranTask) {
if (mShuttingDown) {
IOInterposer::UnregisterCurrentThread();
MOZ_ASSERT(mThreadableTasks.empty());
return;
}
AUTO_PROFILER_LABEL("TaskController::RunPoolThread", IDLE);
mThreadPoolCV.Wait();
}