Chromium Code Reviews
DescriptionProtect 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
Dependent Patchsets: Messages
Total messages: 10 (2 generated)
|
|||||||||||||||||||||||||||||||||||||