Index: src/compilation-statistics.cc |
diff --git a/src/compilation-statistics.cc b/src/compilation-statistics.cc |
index d4ca39d6112a53ba2298d2fe626696d080cbf961..654807cc31c35419880177ef0edb093af732fc97 100644 |
--- a/src/compilation-statistics.cc |
+++ b/src/compilation-statistics.cc |
@@ -14,6 +14,8 @@ namespace internal { |
void CompilationStatistics::RecordPhaseStats(const char* phase_kind_name, |
const char* phase_name, |
const BasicStats& stats) { |
+ base::LockGuard<base::Mutex> guard(&record_mutex_); |
+ |
std::string phase_name_str(phase_name); |
auto it = phase_map_.find(phase_name_str); |
if (it == phase_map_.end()) { |
@@ -26,6 +28,8 @@ void CompilationStatistics::RecordPhaseStats(const char* phase_kind_name, |
void CompilationStatistics::RecordPhaseKindStats(const char* phase_kind_name, |
const BasicStats& stats) { |
+ base::LockGuard<base::Mutex> guard(&record_mutex_); |
+ |
std::string phase_kind_name_str(phase_kind_name); |
auto it = phase_kind_map_.find(phase_kind_name_str); |
if (it == phase_kind_map_.end()) { |
@@ -39,6 +43,8 @@ void CompilationStatistics::RecordPhaseKindStats(const char* phase_kind_name, |
void CompilationStatistics::RecordTotalStats(size_t source_size, |
const BasicStats& stats) { |
+ base::LockGuard<base::Mutex> guard(&record_mutex_); |
+ |
source_size += source_size; |
total_stats_.Accumulate(stats); |
} |