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
CrOS-Libchrome-Original-Commit: d144255434dd27109c30c4e7a8124d76d7e83a4b
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::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_,