Bug 1122408 - Fix potential deadlock codepath. r=BenWa

This commit is contained in:
Kartikaya Gupta 2015-01-17 10:25:57 -05:00
Родитель dac4c08e5a
Коммит 2a521cc77c
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -1249,6 +1249,7 @@ CompositorParent* CompositorParent::RemoveCompositor(uint64_t id)
bool
CompositorParent::RecvNotifyChildCreated(const uint64_t& child)
{
MonitorAutoLock lock(*sIndirectLayerTreesLock);
NotifyChildCreated(child);
return true;
}
@ -1256,7 +1257,7 @@ CompositorParent::RecvNotifyChildCreated(const uint64_t& child)
void
CompositorParent::NotifyChildCreated(const uint64_t& aChild)
{
MonitorAutoLock lock(*sIndirectLayerTreesLock);
sIndirectLayerTreesLock->AssertCurrentThreadOwns();
sIndirectLayerTrees[aChild].mParent = this;
sIndirectLayerTrees[aChild].mLayerManager = mLayerManager;
}
@ -1264,8 +1265,8 @@ CompositorParent::NotifyChildCreated(const uint64_t& aChild)
bool
CompositorParent::RecvAdoptChild(const uint64_t& child)
{
NotifyChildCreated(child);
MonitorAutoLock lock(*sIndirectLayerTreesLock);
NotifyChildCreated(child);
if (sIndirectLayerTrees[child].mLayerTree) {
sIndirectLayerTrees[child].mLayerTree->mLayerManager = mLayerManager;
}