Merge pull request #23 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
1 changed files with 1 additions and 0 deletions

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