diff --git a/util/sync_point.cc b/util/sync_point.cc index 4e4c46a1f..68e99e07b 100644 --- a/util/sync_point.cc +++ b/util/sync_point.cc @@ -14,6 +14,7 @@ SyncPoint* SyncPoint::GetInstance() { } void SyncPoint::LoadDependency(const std::vector& dependencies) { + std::unique_lock lock(mutex_); successors_.clear(); predecessors_.clear(); cleared_points_.clear(); @@ -21,6 +22,7 @@ void SyncPoint::LoadDependency(const std::vector& dependencies) { successors_[dependency.predecessor].push_back(dependency.successor); predecessors_[dependency.successor].push_back(dependency.predecessor); } + cv_.notify_all(); } bool SyncPoint::PredecessorsAllCleared(const std::string& point) {