diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 14:40:10 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-23 14:40:10 +0000 |
commit | d144255434dd27109c30c4e7a8124d76d7e83a4b (patch) | |
tree | 2d3c9768230161683305bbac9cae4d60cb3b6a06 /base/metrics/histogram.h | |
parent | 6d5e8255ed5b7e8865fd20af2530953990376f9f (diff) | |
download | chromium_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/metrics/histogram.h')
-rw-r--r-- | base/metrics/histogram.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h index 562f252..6b09aa3 100644 --- a/base/metrics/histogram.h +++ b/base/metrics/histogram.h @@ -643,7 +643,7 @@ class StatisticsRecorder { ~StatisticsRecorder(); // Find out if histograms can now be registered into our list. - static bool WasStarted(); + static bool IsActive(); // Register, or add a new histogram to the collection of statistics. static void Register(Histogram* histogram); |