Bug 1068981 - Acquire monitor before calling WakeUp. r=roc a=khuey
authorEric Rahm <erahm@mozilla.com>
Mon, 29 Sep 2014 11:46:29 -0700
changeset 225474 32f99eac065c37b349779da239c0731b117f8c92
parent 225473 377ac9d693ed3dcc950d1eaa8e5cf76713b9afd0
child 225475 49bd5bad84d2f69bd89cc50dcb22639637fd9800
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, khuey
bugs1068981
milestone34.0a2
Bug 1068981 - Acquire monitor before calling WakeUp. r=roc a=khuey
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -2854,18 +2854,21 @@ MediaStreamGraphImpl::CollectReports(nsI
 {
   // Clears out the report array after we're done with it.
   ArrayClearer reportCleanup(mAudioStreamSizes);
 
   {
     MonitorAutoLock memoryReportLock(mMemoryReportMonitor);
     mNeedsMemoryReport = true;
 
-    // Wake up the MSG thread.
-    CurrentDriver()->WakeUp();
+    {
+      // Wake up the MSG thread.
+      MonitorAutoLock monitorLock(mMonitor);
+      CurrentDriver()->WakeUp();
+    }
 
     if (mLifecycleState >= LIFECYCLE_WAITING_FOR_THREAD_SHUTDOWN) {
       // Shutting down, nothing to report.
       return NS_OK;
     }
 
     // Wait for up to one second for the report to complete.
     nsresult rv;