Bug 1253516 - Do not acquire a lock that protects data that is not used; r=vporof
authorNick Fitzgerald <fitzgen@gmail.com>
Mon, 14 Mar 2016 11:44:00 +0100
changeset 288944 ffdeaea4ceae
parent 288943 3a99126a3b55
child 288945 e109baaf9e01
push id73628
push usercbook@mozilla.com
push date2016-03-16 10:02 +0000
treeherdermozilla-inbound@ffdeaea4ceae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvporof
bugs1253516
milestone48.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 1253516 - Do not acquire a lock that protects data that is not used; r=vporof `sMutex` protects the `mMarkersStores` data member, but neither `TimelineConsumers::PopMarkers` nor `ObservedDocShell::PopMarkers` use that data member. Removing this lock acquisition also fixes a dead lock where we re-entrantly attempt to acquire the lock when triggering a GC when allocating JS objects inside `ObservedDocShell::PopMarkers`.
docshell/base/timeline/TimelineConsumers.cpp
--- a/docshell/base/timeline/TimelineConsumers.cpp
+++ b/docshell/base/timeline/TimelineConsumers.cpp
@@ -295,17 +295,16 @@ TimelineConsumers::AddMarkerForAllObserv
 }
 
 void
 TimelineConsumers::PopMarkers(nsDocShell* aDocShell,
                               JSContext* aCx,
                               nsTArray<dom::ProfileTimelineMarker>& aStore)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  StaticMutexAutoLock lock(sMutex); // for `mMarkersStores`.
 
   if (!aDocShell || !aDocShell->mObserved) {
     return;
   }
 
   aDocShell->mObserved->PopMarkers(aCx, aStore);
 }