summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/reporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/reporter.cpp')
-rw-r--r--src/mongo/db/repl/reporter.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mongo/db/repl/reporter.cpp b/src/mongo/db/repl/reporter.cpp
index 5e7c852d211..d659ee83965 100644
--- a/src/mongo/db/repl/reporter.cpp
+++ b/src/mongo/db/repl/reporter.cpp
@@ -118,17 +118,17 @@ std::string Reporter::toString() const {
}
HostAndPort Reporter::getTarget() const {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
return _target;
}
Milliseconds Reporter::getKeepAliveInterval() const {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
return _keepAliveInterval;
}
void Reporter::shutdown() {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
_status = Status(ErrorCodes::CallbackCanceled, "Reporter no longer valid");
@@ -152,13 +152,13 @@ void Reporter::shutdown() {
}
Status Reporter::join() {
- stdx::unique_lock<stdx::mutex> lk(_mutex);
+ stdx::unique_lock<Latch> lk(_mutex);
_condition.wait(lk, [this]() { return !_isActive_inlock(); });
return _status;
}
Status Reporter::trigger() {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
// If these was a previous error then the reporter is dead and return that error.
if (!_status.isOK()) {
@@ -196,7 +196,7 @@ Status Reporter::trigger() {
StatusWith<BSONObj> Reporter::_prepareCommand() {
auto prepareResult = _prepareReplSetUpdatePositionCommandFn();
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
// Reporter could have been canceled while preparing the command.
if (!_status.isOK()) {
@@ -239,7 +239,7 @@ void Reporter::_sendCommand_inlock(BSONObj commandRequest, Milliseconds netTimeo
void Reporter::_processResponseCallback(
const executor::TaskExecutor::RemoteCommandCallbackArgs& rcbd) {
{
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
// If the reporter was shut down before this callback is invoked,
// return the canceled "_status".
@@ -299,7 +299,7 @@ void Reporter::_processResponseCallback(
// Must call without holding the lock.
auto prepareResult = _prepareCommand();
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
if (!_status.isOK()) {
_onShutdown_inlock();
return;
@@ -318,7 +318,7 @@ void Reporter::_processResponseCallback(
void Reporter::_prepareAndSendCommandCallback(const executor::TaskExecutor::CallbackArgs& args,
bool fromTrigger) {
{
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
if (!_status.isOK()) {
_onShutdown_inlock();
return;
@@ -341,7 +341,7 @@ void Reporter::_prepareAndSendCommandCallback(const executor::TaskExecutor::Call
// Must call without holding the lock.
auto prepareResult = _prepareCommand();
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
if (!_status.isOK()) {
_onShutdown_inlock();
return;
@@ -367,7 +367,7 @@ void Reporter::_onShutdown_inlock() {
}
bool Reporter::isActive() const {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
return _isActive_inlock();
}
@@ -376,12 +376,12 @@ bool Reporter::_isActive_inlock() const {
}
bool Reporter::isWaitingToSendReport() const {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
return _isWaitingToSendReporter;
}
Date_t Reporter::getKeepAliveTimeoutWhen_forTest() const {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
return _keepAliveTimeoutWhen;
}