diff options
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp index 1fee696bc79..b86748b09f1 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp @@ -256,7 +256,7 @@ void WiredTigerSessionCache::waitUntilDurable(bool forceCheckpoint, bool stableC UniqueWiredTigerSession session = getSession(); WT_SESSION* s = session->getSession(); { - stdx::unique_lock<stdx::mutex> lk(_journalListenerMutex); + stdx::unique_lock<Latch> lk(_journalListenerMutex); JournalListener::Token token = _journalListener->getToken(); auto config = stableCheckpoint ? "use_timestamp=true" : "use_timestamp=false"; invariantWTOK(s->checkpoint(s, config)); @@ -269,7 +269,7 @@ void WiredTigerSessionCache::waitUntilDurable(bool forceCheckpoint, bool stableC uint32_t start = _lastSyncTime.load(); // Do the remainder in a critical section that ensures only a single thread at a time // will attempt to synchronize. - stdx::unique_lock<stdx::mutex> lk(_lastSyncMutex); + stdx::unique_lock<Latch> lk(_lastSyncMutex); uint32_t current = _lastSyncTime.loadRelaxed(); // synchronized with writes through mutex if (current != start) { // Someone else synced already since we read lastSyncTime, so we're done! @@ -281,7 +281,7 @@ void WiredTigerSessionCache::waitUntilDurable(bool forceCheckpoint, bool stableC // This gets the token (OpTime) from the last write, before flushing (either the journal, or a // checkpoint), and then reports that token (OpTime) as a durable write. - stdx::unique_lock<stdx::mutex> jlk(_journalListenerMutex); + stdx::unique_lock<Latch> jlk(_journalListenerMutex); JournalListener::Token token = _journalListener->getToken(); // Initialize on first use. @@ -304,7 +304,7 @@ void WiredTigerSessionCache::waitUntilDurable(bool forceCheckpoint, bool stableC void WiredTigerSessionCache::waitUntilPreparedUnitOfWorkCommitsOrAborts(OperationContext* opCtx, std::uint64_t lastCount) { invariant(opCtx); - stdx::unique_lock<stdx::mutex> lk(_prepareCommittedOrAbortedMutex); + stdx::unique_lock<Latch> lk(_prepareCommittedOrAbortedMutex); if (lastCount == _prepareCommitOrAbortCounter.loadRelaxed()) { opCtx->waitForConditionOrInterrupt(_prepareCommittedOrAbortedCond, lk, [&] { return _prepareCommitOrAbortCounter.loadRelaxed() > lastCount; @@ -313,14 +313,14 @@ void WiredTigerSessionCache::waitUntilPreparedUnitOfWorkCommitsOrAborts(Operatio } void WiredTigerSessionCache::notifyPreparedUnitOfWorkHasCommittedOrAborted() { - stdx::unique_lock<stdx::mutex> lk(_prepareCommittedOrAbortedMutex); + stdx::unique_lock<Latch> lk(_prepareCommittedOrAbortedMutex); _prepareCommitOrAbortCounter.fetchAndAdd(1); _prepareCommittedOrAbortedCond.notify_all(); } void WiredTigerSessionCache::closeAllCursors(const std::string& uri) { - stdx::lock_guard<stdx::mutex> lock(_cacheLock); + stdx::lock_guard<Latch> lock(_cacheLock); for (SessionCache::iterator i = _sessions.begin(); i != _sessions.end(); i++) { (*i)->closeAllCursors(uri); } @@ -330,14 +330,14 @@ void WiredTigerSessionCache::closeCursorsForQueuedDrops() { // Increment the cursor epoch so that all cursors from this epoch are closed. _cursorEpoch.fetchAndAdd(1); - stdx::lock_guard<stdx::mutex> lock(_cacheLock); + stdx::lock_guard<Latch> lock(_cacheLock); for (SessionCache::iterator i = _sessions.begin(); i != _sessions.end(); i++) { (*i)->closeCursorsForQueuedDrops(_engine); } } size_t WiredTigerSessionCache::getIdleSessionsCount() { - stdx::lock_guard<stdx::mutex> lock(_cacheLock); + stdx::lock_guard<Latch> lock(_cacheLock); return _sessions.size(); } @@ -349,7 +349,7 @@ void WiredTigerSessionCache::closeExpiredIdleSessions(int64_t idleTimeMillis) { auto cutoffTime = _clockSource->now() - Milliseconds(idleTimeMillis); { - stdx::lock_guard<stdx::mutex> lock(_cacheLock); + stdx::lock_guard<Latch> lock(_cacheLock); // Discard all sessions that became idle before the cutoff time for (auto it = _sessions.begin(); it != _sessions.end();) { auto session = *it; @@ -369,7 +369,7 @@ void WiredTigerSessionCache::closeAll() { SessionCache swap; { - stdx::lock_guard<stdx::mutex> lock(_cacheLock); + stdx::lock_guard<Latch> lock(_cacheLock); _epoch.fetchAndAdd(1); _sessions.swap(swap); } @@ -389,7 +389,7 @@ UniqueWiredTigerSession WiredTigerSessionCache::getSession() { invariant(!(_shuttingDown.loadRelaxed() & kShuttingDownMask)); { - stdx::lock_guard<stdx::mutex> lock(_cacheLock); + stdx::lock_guard<Latch> lock(_cacheLock); if (!_sessions.empty()) { // Get the most recently used session so that if we discard sessions, we're // discarding older ones @@ -456,7 +456,7 @@ void WiredTigerSessionCache::releaseSession(WiredTigerSession* session) { session->setIdleExpireTime(_clockSource->now()); if (session->_getEpoch() == currentEpoch) { // check outside of lock to reduce contention - stdx::lock_guard<stdx::mutex> lock(_cacheLock); + stdx::lock_guard<Latch> lock(_cacheLock); if (session->_getEpoch() == _epoch.load()) { // recheck inside the lock for correctness returnedToCache = true; _sessions.push_back(session); @@ -473,7 +473,7 @@ void WiredTigerSessionCache::releaseSession(WiredTigerSession* session) { void WiredTigerSessionCache::setJournalListener(JournalListener* jl) { - stdx::unique_lock<stdx::mutex> lk(_journalListenerMutex); + stdx::unique_lock<Latch> lk(_journalListenerMutex); _journalListener = jl; } |