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 ffdeaea4ceaeafe10594ae274acf2c1d913b6f33
parent 288943 3a99126a3b55fc9f4bd327c4ed232cfd4284dcde
child 288945 e109baaf9e019f71824fb481f77409da112423a8
push id73628
push usercbook@mozilla.com
push dateWed, 16 Mar 2016 10:02:13 +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);
 }