зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1686222: Ensure proper thread is woken up when a new task is posted. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D102324
This commit is contained in:
Родитель
03c0b5f0e4
Коммит
f346ba1851
|
@ -833,11 +833,11 @@ void TaskController::MaybeInterruptTask(Task* aTask) {
|
|||
return;
|
||||
}
|
||||
|
||||
EnsureMainThreadTasksScheduled();
|
||||
|
||||
if (aTask->IsMainThreadOnly()) {
|
||||
mMayHaveMainThreadTask = true;
|
||||
|
||||
EnsureMainThreadTasksScheduled();
|
||||
|
||||
if (mCurrentTasksMT.empty()) {
|
||||
return;
|
||||
}
|
||||
|
@ -855,6 +855,7 @@ void TaskController::MaybeInterruptTask(Task* aTask) {
|
|||
Task* lowestPriorityTask = nullptr;
|
||||
for (PoolThread& thread : mPoolThreads) {
|
||||
if (!thread.mCurrentTask) {
|
||||
mThreadPoolCV.Notify();
|
||||
// There's a free thread, no need to interrupt anything.
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче