Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Issue 1923193002: Protect TraceLog::enabled_state_observer_list_ with a dedicated lock (Closed)

Created:
4 years, 7 months ago by Xiaocheng
Modified:
4 years, 7 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Protect TraceLog::enabled_state_observer_list_ with a dedicated lock TraceLog dispatches events to observers without protection of any lock, which is a source of data race. However, we can't simply protect it with TraceLog::lock_ because that leads to deadlock. Hence, this patch introduces a dedicated lock to protect accesses to the observer list without causing deadlock. To prevent introducing new deadlocks, this patch also sets a policy that any subclass of EnabledStateObserver must not try to access the TraceLog's observer list from the OnTraceLogEnabled()/Disabled() callbacks. Unit test TraceEventTestFixture.SelfRemovingObserver is removed due to violation of the policy. BUG=546021

Patch Set 1 #

Patch Set 2 : New policy on EnabledStateObserver's callbacks, and remove TraceEventTestFixture.SelfRemovingObserv… #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -104 lines) Patch
M base/trace_event/trace_event_unittest.cc View 1 1 chunk +0 lines, -29 lines 2 comments Download
M base/trace_event/trace_log.h View 1 3 chunks +17 lines, -5 lines 0 comments Download
M base/trace_event/trace_log.cc View 4 chunks +68 lines, -70 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 10 (2 generated)
Xiaocheng
This patch should be necessary if we want to fix any data race related to ...
4 years, 7 months ago (2016-04-27 12:18:28 UTC) #3
Primiano Tucci (use gerrit)
Let me have a chat with skyostil@, and see if there is a way to ...
4 years, 7 months ago (2016-04-27 13:50:21 UTC) #4
Xiaocheng
Thanks for the review. It seems very difficult to get rid of the race that ...
4 years, 7 months ago (2016-04-27 14:18:13 UTC) #5
Sami
We did some deep thinking with Primiano and ended up with this idea: Since the ...
4 years, 7 months ago (2016-04-28 15:33:02 UTC) #6
Primiano Tucci (use gerrit)
On 2016/04/28 15:33:02, Sami (slow -- travelling) wrote: > Primiano will post a C++ version ...
4 years, 7 months ago (2016-04-28 15:34:34 UTC) #7
Xiaocheng
On 2016/04/28 at 15:34:34, primiano wrote: > On 2016/04/28 15:33:02, Sami (slow -- travelling) wrote: ...
4 years, 7 months ago (2016-05-09 02:26:24 UTC) #8
Primiano Tucci (use gerrit)
Can this CL be closed in favor of crrev.com/1956323002 ? it just keep showing in ...
4 years, 7 months ago (2016-05-10 16:06:05 UTC) #9
Xiaocheng
4 years, 7 months ago (2016-05-11 00:31:10 UTC) #10
On 2016/05/10 at 16:06:05, primiano wrote:
> Can this CL be closed in favor of crrev.com/1956323002 ? it just keep showing
in my review list.

Closed.

Powered by Google App Engine
This is Rietveld 408576698