diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 23:07:19 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 23:07:19 +0000 |
commit | 2862086530e94dab7ab55e842601661aabd8a408 (patch) | |
tree | 31fc3c9027af9d89c1fdfd671cfe1ea1968e0c8c /base/metrics | |
parent | 81cbbeba77b50e09cf52c7da09ed5ff88056cd28 (diff) | |
download | chromium_src-2862086530e94dab7ab55e842601661aabd8a408.zip chromium_src-2862086530e94dab7ab55e842601661aabd8a408.tar.gz chromium_src-2862086530e94dab7ab55e842601661aabd8a408.tar.bz2 |
Removed the static on all stats macros and changed the static declaration
of StatsCounter, StatsCounterTimer and StatsRate variables to auto. This
change would fix possibel race condition during static's initialization
in multi-threaded environments.
BUG=76980
TEST=unit tests in net, browser and plugins
R=jar@chromium.org
Review URL: http://codereview.chromium.org/6719011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/metrics')
-rw-r--r-- | base/metrics/stats_counters.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/base/metrics/stats_counters.h b/base/metrics/stats_counters.h index 2de2b73..4a93a41 100644 --- a/base/metrics/stats_counters.h +++ b/base/metrics/stats_counters.h @@ -46,14 +46,14 @@ namespace base { //------------------------------------------------------------------------------ // First provide generic macros, which exist in production as well as debug. #define STATS_COUNTER(name, delta) do { \ - static base::StatsCounter counter(name); \ + base::StatsCounter counter(name); \ counter.Add(delta); \ } while (0) #define SIMPLE_STATS_COUNTER(name) STATS_COUNTER(name, 1) #define RATE_COUNTER(name, duration) do { \ - static base::StatsRate hit_count(name); \ + base::StatsRate hit_count(name); \ hit_count.AddTime(duration); \ } while (0) |