Commit e5a43199 by Dominic Hamon

Merge pull request #23 from ckennelly/clock_initialization

Resolve race on approx_time_ in FastClock.
parents 46507cb2 2c9b29c9
...@@ -577,6 +577,7 @@ class State::FastClock { ...@@ -577,6 +577,7 @@ class State::FastClock {
// function starts running - see UseRealTime). // function starts running - see UseRealTime).
void InitType(Type type) { void InitType(Type type) {
type_ = type; type_ = type;
mutex_lock l(&bg_mutex_);
std::atomic_store(&approx_time_, NowMicros()); std::atomic_store(&approx_time_, NowMicros());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment