зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1637890 - P3. Ensure an AbstractThread exists when dispatching a task. r=froydnj
When performing the last GC, remaining state watchers would dispatch direct tasks ; this was exposed with P3. Ensure this never happens. Differential Revision: https://phabricator.services.mozilla.com/D75499
This commit is contained in:
Родитель
de5872ee7a
Коммит
906437cc5d
|
@ -262,6 +262,7 @@ void AbstractThread::ShutdownMainThread() {
|
|||
void AbstractThread::DispatchStateChange(
|
||||
already_AddRefed<nsIRunnable> aRunnable) {
|
||||
AbstractThread* currentThread = GetCurrent();
|
||||
MOZ_DIAGNOSTIC_ASSERT(currentThread, "An AbstractThread must exist");
|
||||
if (currentThread->IsTailDispatcherAvailable()) {
|
||||
currentThread->TailDispatcher().AddStateChangeTask(this,
|
||||
std::move(aRunnable));
|
||||
|
@ -280,6 +281,7 @@ void AbstractThread::DispatchStateChange(
|
|||
void AbstractThread::DispatchDirectTask(
|
||||
already_AddRefed<nsIRunnable> aRunnable) {
|
||||
AbstractThread* currentThread = GetCurrent();
|
||||
MOZ_DIAGNOSTIC_ASSERT(currentThread, "An AbstractThread must exist");
|
||||
if (currentThread->IsTailDispatcherAvailable()) {
|
||||
currentThread->TailDispatcher().AddDirectTask(std::move(aRunnable));
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче