bug 1406831 tighten AssertOnGraphThreadOrNotRunning() to not accept graph thread after mDetectedNotRunning r=pehrsons
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 28 Sep 2017 12:17:22 +1300
changeset 385304 f534d96564e0641b61e75411099afb60604d24f2
parent 385303 f6348624e8701ddd3e8c500d9da72e063c649637
child 385305 e3f39de40209900202f62dc52e68921156d9d0bb
push id32652
push userarchaeopteryx@coole-files.de
push dateTue, 10 Oct 2017 21:49:31 +0000
treeherdermozilla-central@f1ecd5c26948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1406831, 1406830
milestone58.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 1406831 tighten AssertOnGraphThreadOrNotRunning() to not accept graph thread after mDetectedNotRunning r=pehrsons This also permits setting mDriver to null after mDetectedNotRunning, which is useful for fixing bug 1406830. MozReview-Commit-ID: EEgAxqPQPRI
dom/media/MediaStreamGraph.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1119,21 +1119,20 @@ void
 MediaStreamGraph::AssertOnGraphThreadOrNotRunning() const
 {
   // either we're on the right thread (and calling CurrentDriver() is safe),
   // or we're going to assert anyways, so don't cross-check CurrentDriver
 #ifdef DEBUG
   MediaStreamGraphImpl const * graph =
     static_cast<MediaStreamGraphImpl const *>(this);
   // if all the safety checks fail, assert we own the monitor
-  if (!graph->mDriver->OnThread()) {
-    if (!(graph->mDetectedNotRunning &&
-          NS_IsMainThread())) {
+  if (!(graph->mDetectedNotRunning ?
+        NS_IsMainThread() : graph->mDriver->OnThread()))
+  {
       graph->mMonitor.AssertCurrentThreadOwns();
-    }
   }
 #endif
 }
 
 bool
 MediaStreamGraphImpl::ShouldUpdateMainThread()
 {
   if (mRealtime) {