diff options
Diffstat (limited to 'src/mongo/db/repl/abstract_oplog_fetcher.cpp')
-rw-r--r-- | src/mongo/db/repl/abstract_oplog_fetcher.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/db/repl/abstract_oplog_fetcher.cpp b/src/mongo/db/repl/abstract_oplog_fetcher.cpp index 4bb2762219a..0cdf534cfe7 100644 --- a/src/mongo/db/repl/abstract_oplog_fetcher.cpp +++ b/src/mongo/db/repl/abstract_oplog_fetcher.cpp @@ -40,7 +40,7 @@ #include "mongo/db/commands/server_status_metric.h" #include "mongo/db/jsobj.h" #include "mongo/db/repl/repl_server_parameters_gen.h" -#include "mongo/stdx/mutex.h" +#include "mongo/platform/mutex.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" @@ -93,7 +93,7 @@ Milliseconds AbstractOplogFetcher::_getGetMoreMaxTime() const { } std::string AbstractOplogFetcher::toString() const { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); str::stream msg; msg << _getComponentName() << " -" << " last optime fetched: " << _lastFetched.toString(); @@ -118,7 +118,7 @@ void AbstractOplogFetcher::_makeAndScheduleFetcherCallback( Status scheduleStatus = Status::OK(); { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); _fetcher = _makeFetcher(findCommandObj, metadataObj, _getInitialFindMaxTime()); scheduleStatus = _scheduleFetcher_inlock(); } @@ -144,7 +144,7 @@ void AbstractOplogFetcher::_doShutdown_inlock() noexcept { } } -stdx::mutex* AbstractOplogFetcher::_getMutex() noexcept { +Mutex* AbstractOplogFetcher::_getMutex() noexcept { return &_mutex; } @@ -158,12 +158,12 @@ OpTime AbstractOplogFetcher::getLastOpTimeFetched_forTest() const { } OpTime AbstractOplogFetcher::_getLastOpTimeFetched() const { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); return _lastFetched; } BSONObj AbstractOplogFetcher::getCommandObject_forTest() const { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); return _fetcher->getCommandObject(); } @@ -198,7 +198,7 @@ void AbstractOplogFetcher::_callback(const Fetcher::QueryResponseStatus& result, _makeFindCommandObject(_nss, _getLastOpTimeFetched(), _getRetriedFindMaxTime()); BSONObj metadataObj = _makeMetadataObject(); { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); if (_fetcherRestarts == _maxFetcherRestarts) { log() << "Error returned from oplog query (no more query restarts left): " << redact(responseStatus); @@ -230,7 +230,7 @@ void AbstractOplogFetcher::_callback(const Fetcher::QueryResponseStatus& result, // Reset fetcher restart counter on successful response. { - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); invariant(_isActive_inlock()); _fetcherRestarts = 0; } @@ -275,7 +275,7 @@ void AbstractOplogFetcher::_callback(const Fetcher::QueryResponseStatus& result, LOG(3) << _getComponentName() << " setting last fetched optime ahead after batch: " << lastDoc; - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); _lastFetched = lastDoc; } @@ -296,7 +296,7 @@ void AbstractOplogFetcher::_finishCallback(Status status) { _onShutdownCallbackFn(status); decltype(_onShutdownCallbackFn) onShutdownCallbackFn; - stdx::lock_guard<stdx::mutex> lock(_mutex); + stdx::lock_guard<Latch> lock(_mutex); _transitionToComplete_inlock(); // Release any resources that might be held by the '_onShutdownCallbackFn' function object. |