diff options
author | Ben Caimano <ben.caimano@mongodb.com> | 2019-09-17 23:22:19 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-17 23:22:19 +0000 |
commit | bc11369435ca51e2ff6897433d00f6b909f6a25f (patch) | |
tree | 251653ec8285d798b41846e343e7e414e80ff277 /src/mongo/db/pipeline/document_source_exchange.cpp | |
parent | 45aea2495306dd61fab46bd398735bb6aaf7b53a (diff) | |
download | mongo-bc11369435ca51e2ff6897433d00f6b909f6a25f.tar.gz |
SERVER-42165 Replace uses of stdx::mutex with mongo::Mutex
Diffstat (limited to 'src/mongo/db/pipeline/document_source_exchange.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_exchange.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/pipeline/document_source_exchange.cpp b/src/mongo/db/pipeline/document_source_exchange.cpp index 76ca6839e96..9e8e37e97cd 100644 --- a/src/mongo/db/pipeline/document_source_exchange.cpp +++ b/src/mongo/db/pipeline/document_source_exchange.cpp @@ -48,13 +48,13 @@ MONGO_FAIL_POINT_DEFINE(exchangeFailLoadNextBatch); class MutexAndResourceLock { OperationContext* _opCtx; ResourceYielder* _resourceYielder; - stdx::unique_lock<stdx::mutex> _lock; + stdx::unique_lock<Latch> _lock; public: // Must be constructed with the mutex held. 'yielder' may be null if there are no resources // which need to be yielded while waiting. MutexAndResourceLock(OperationContext* opCtx, - stdx::unique_lock<stdx::mutex> m, + stdx::unique_lock<Latch> m, ResourceYielder* yielder) : _opCtx(opCtx), _resourceYielder(yielder), _lock(std::move(m)) { invariant(_lock.owns_lock()); @@ -78,7 +78,7 @@ public: * Releases ownership of the lock to the caller. May only be called when the mutex is held * (after a call to unlock(), for example). */ - stdx::unique_lock<stdx::mutex> releaseLockOwnership() { + stdx::unique_lock<Latch> releaseLockOwnership() { invariant(_lock.owns_lock()); return std::move(_lock); } @@ -280,7 +280,7 @@ DocumentSource::GetNextResult Exchange::getNext(OperationContext* opCtx, size_t consumerId, ResourceYielder* resourceYielder) { // Grab a lock. - stdx::unique_lock<stdx::mutex> lk(_mutex); + stdx::unique_lock<Latch> lk(_mutex); for (;;) { // Guard against some of the trickiness we do with moving the lock to/from the @@ -438,7 +438,7 @@ size_t Exchange::getTargetConsumer(const Document& input) { } void Exchange::dispose(OperationContext* opCtx, size_t consumerId) { - stdx::lock_guard<stdx::mutex> lk(_mutex); + stdx::lock_guard<Latch> lk(_mutex); invariant(_disposeRunDown < getConsumers()); |