diff --git a/src/benchmark.cc b/src/benchmark.cc index de8d44d4..1ad2e32a 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -577,6 +577,7 @@ class State::FastClock { // function starts running - see UseRealTime). void InitType(Type type) { type_ = type; + mutex_lock l(&bg_mutex_); std::atomic_store(&approx_time_, NowMicros()); }