mirror of https://github.com/google/benchmark.git
Merge pull request #23 from ckennelly/clock_initialization
Resolve race on approx_time_ in FastClock.
This commit is contained in:
commit
e5a431998d
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue