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 288957 ffdeaea4ceae
parent 288956 3a99126a3b55
child 288958 e109baaf9e01
push id30093
push userkwierso@gmail.com
push dateWed, 16 Mar 2016 23:33:15 +0000
treeherdermozilla-central@20218dd51efa [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);
 }