1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-18 07:22:08 +08:00

Merge pull request from ckennelly/clock_initialization

Resolve race on approx_time_ in FastClock.
This commit is contained in:
Dominic Hamon 2014-05-05 10:03:11 -07:00
commit e5a431998d

View File

@ -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());
}