summaryrefslogtreecommitdiffstats
path: root/base/message_loop.cc
diff options
context:
space:
mode:
authormad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 14:40:10 +0000
committermad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 14:40:10 +0000
commitd144255434dd27109c30c4e7a8124d76d7e83a4b (patch)
tree2d3c9768230161683305bbac9cae4d60cb3b6a06 /base/message_loop.cc
parent6d5e8255ed5b7e8865fd20af2530953990376f9f (diff)
downloadchromium_src-d144255434dd27109c30c4e7a8124d76d7e83a4b.zip
chromium_src-d144255434dd27109c30c4e7a8124d76d7e83a4b.tar.gz
chromium_src-d144255434dd27109c30c4e7a8124d76d7e83a4b.tar.bz2
Properly lock access to static variables.
There were a few race conditions where the static method would test the validity of the hitograms_ static variable before attempting to use the lock_ to protect access to it but nothing then prevented the destructor to free both the lock_ and the hitograms_ memory. So I decided to not use a dynamic allocation of the static lock_ to resolve this problem. BUG=38354 TEST=Hard to repro exit scenario crashes. Review URL: http://codereview.chromium.org/5784005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r--base/message_loop.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 7941457..49d76a0 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -639,7 +639,7 @@ void MessageLoop::EnableHistogrammer(bool enable) {
void MessageLoop::StartHistogrammer() {
if (enable_histogrammer_ && !message_histogram_.get()
- && base::StatisticsRecorder::WasStarted()) {
+ && base::StatisticsRecorder::IsActive()) {
DCHECK(!thread_name_.empty());
message_histogram_ = base::LinearHistogram::FactoryGet(
"MsgLoop:" + thread_name_,