Bug 1122408 - Fix potential deadlock codepath. r=BenWa, a=sledru
authorKartikaya Gupta <kgupta@mozilla.com>
Sat, 17 Jan 2015 10:25:57 -0500
changeset 200521 c4c37781a80229558c3bb8990d31672aa1c23f7c
parent 200520 c9851e1e1b9cd5545417c0b031d9a9287da9ae56
child 200522 0fa692e8f1764acbd01ae68bbd50c89a2bdcff8b
push id170
push userryanvm@gmail.com
push dateTue, 20 Jan 2015 15:08:20 +0000
treeherdermozilla-esr31@0fa692e8f176 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa, sledru
bugs1122408
milestone31.4.0
Bug 1122408 - Fix potential deadlock codepath. r=BenWa, a=sledru
gfx/layers/ipc/CompositorParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -982,24 +982,25 @@ CompositorParent* CompositorParent::Remo
   CompositorParent *retval = it->second;
   sCompositorMap->erase(it);
   return retval;
 }
 
 bool
 CompositorParent::RecvNotifyChildCreated(const uint64_t& child)
 {
+  MonitorAutoLock lock(*sIndirectLayerTreesLock);
   NotifyChildCreated(child);
   return true;
 }
 
 void
 CompositorParent::NotifyChildCreated(uint64_t aChild)
 {
-  MonitorAutoLock lock(*sIndirectLayerTreesLock);
+  sIndirectLayerTreesLock->AssertCurrentThreadOwns();
   sIndirectLayerTrees[aChild].mParent = this;
   sIndirectLayerTrees[aChild].mLayerManager = mLayerManager;
 }
 
 /*static*/ uint64_t
 CompositorParent::AllocateLayerTreeId()
 {
   MOZ_ASSERT(CompositorLoop());