Bug 1282992 - Improve sync event loop shutdown in workers, r=khuey a=ritu
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 06 Jul 2016 08:36:54 +0200
changeset 341887 1855158bd62c34b5c931e9092f196b305d392382
parent 341886 dd939576757577e1580b84e0820f9eb2d77dd303
child 341888 d44a440ae78d1184f942db0298777f5afe09a807
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, ritu
bugs1282992
milestone49.0a2
Bug 1282992 - Improve sync event loop shutdown in workers, r=khuey a=ritu
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -5499,18 +5499,18 @@ WorkerPrivate::DestroySyncLoop(uint32_t 
 
     // This will delete |loopInfo|!
     mSyncLoopStack.RemoveElementAt(aLoopIndex);
   }
 
   MOZ_ALWAYS_SUCCEEDS(aThread->PopEventQueue(nestedEventTarget));
 
   if (!mSyncLoopStack.Length() && mPendingEventQueueClearing) {
+    mPendingEventQueueClearing = false;
     ClearMainEventQueue(WorkerRan);
-    mPendingEventQueueClearing = false;
   }
 
   return result;
 }
 
 void
 WorkerPrivate::StopSyncLoop(nsIEventTarget* aSyncLoopTarget, bool aResult)
 {