Bug 1631304 - Don't lazily create a TailDispatcher from MaybeDrainDirectTasks. r=jya
authorBobby Holley <bobbyholley@gmail.com>
Tue, 28 Apr 2020 21:18:15 +0000
changeset 526565 7d0595a40d4e4b4d55fe3bc6eda16324929aa3a3
parent 526564 63aa05c6c9b02d377e188de636958e2ab5094d20
child 526566 a33a94d662338261a5fc84215be617bdda1fcb29
push id37358
push useropoprus@mozilla.com
push dateWed, 29 Apr 2020 03:05:14 +0000
treeherdermozilla-central@6bb8423186c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1631304
milestone77.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1631304 - Don't lazily create a TailDispatcher from MaybeDrainDirectTasks. r=jya Differential Revision: https://phabricator.services.mozilla.com/D72262
xpcom/threads/TaskDispatcher.h
--- a/xpcom/threads/TaskDispatcher.h
+++ b/xpcom/threads/TaskDispatcher.h
@@ -201,17 +201,17 @@ class AutoTaskDispatcher : public TaskDi
       }
 
       return NS_OK;
     }
 
    private:
     void MaybeDrainDirectTasks() {
       AbstractThread* currentThread = AbstractThread::GetCurrent();
-      if (currentThread) {
+      if (currentThread && currentThread->MightHaveTailTasks()) {
         currentThread->TailDispatcher().DrainDirectTasks();
       }
     }
 
     UniquePtr<PerThreadTaskGroup> mTasks;
   };
 
   PerThreadTaskGroup& EnsureTaskGroup(AbstractThread* aThread) {