diff options
Diffstat (limited to 'src/mongo/db/logical_clock.cpp')
-rw-r--r-- | src/mongo/db/logical_clock.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/logical_clock.cpp b/src/mongo/db/logical_clock.cpp index 415566094d2..5cc982465d9 100644 --- a/src/mongo/db/logical_clock.cpp +++ b/src/mongo/db/logical_clock.cpp @@ -76,12 +76,12 @@ void LogicalClock::set(ServiceContext* service, std::unique_ptr<LogicalClock> cl LogicalClock::LogicalClock(ServiceContext* service) : _service(service) {} LogicalTime LogicalClock::getClusterTime() { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); return _clusterTime; } Status LogicalClock::advanceClusterTime(const LogicalTime newTime) { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); auto rateLimitStatus = _passesRateLimiter_inlock(newTime); if (!rateLimitStatus.isOK()) { @@ -99,7 +99,7 @@ LogicalTime LogicalClock::reserveTicks(uint64_t nTicks) { invariant(nTicks > 0 && nTicks <= kMaxSignedInt); - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); LogicalTime clusterTime = _clusterTime; @@ -142,7 +142,7 @@ LogicalTime LogicalClock::reserveTicks(uint64_t nTicks) { } void LogicalClock::setClusterTimeFromTrustedSource(LogicalTime newTime) { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); // Rate limit checks are skipped here so a server with no activity for longer than // maxAcceptableLogicalClockDriftSecs seconds can still have its cluster time initialized. @@ -177,12 +177,12 @@ Status LogicalClock::_passesRateLimiter_inlock(LogicalTime newTime) { } bool LogicalClock::isEnabled() const { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); return _isEnabled; } void LogicalClock::disable() { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); _isEnabled = false; } |