summaryrefslogtreecommitdiff
path: root/src/mongo/client/authenticate.cpp
diff options
context:
space:
mode:
authorBen Caimano <ben.caimano@mongodb.com>2019-09-17 23:22:19 +0000
committerevergreen <evergreen@mongodb.com>2019-09-17 23:22:19 +0000
commitbc11369435ca51e2ff6897433d00f6b909f6a25f (patch)
tree251653ec8285d798b41846e343e7e414e80ff277 /src/mongo/client/authenticate.cpp
parent45aea2495306dd61fab46bd398735bb6aaf7b53a (diff)
downloadmongo-bc11369435ca51e2ff6897433d00f6b909f6a25f.tar.gz
SERVER-42165 Replace uses of stdx::mutex with mongo::Mutex
Diffstat (limited to 'src/mongo/client/authenticate.cpp')
-rw-r--r--src/mongo/client/authenticate.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/client/authenticate.cpp b/src/mongo/client/authenticate.cpp
index f035312e4f7..e76f72035a3 100644
--- a/src/mongo/client/authenticate.cpp
+++ b/src/mongo/client/authenticate.cpp
@@ -42,9 +42,9 @@
#include "mongo/db/auth/authorization_manager.h"
#include "mongo/db/auth/sasl_command_constants.h"
#include "mongo/db/server_options.h"
+#include "mongo/platform/mutex.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/rpc/op_msg_rpc_impls.h"
-#include "mongo/stdx/mutex.h"
#include "mongo/util/log.h"
#include "mongo/util/net/ssl_manager.h"
#include "mongo/util/net/ssl_options.h"
@@ -186,13 +186,13 @@ Future<void> authenticateClient(const BSONObj& params,
AuthMongoCRHandler authMongoCR = authMongoCRImpl;
-static stdx::mutex internalAuthKeysMutex;
+static auto internalAuthKeysMutex = MONGO_MAKE_LATCH();
static bool internalAuthSet = false;
static std::vector<std::string> internalAuthKeys;
static BSONObj internalAuthParams;
void setInternalAuthKeys(const std::vector<std::string>& keys) {
- stdx::lock_guard<stdx::mutex> lk(internalAuthKeysMutex);
+ stdx::lock_guard<Latch> lk(internalAuthKeysMutex);
internalAuthKeys = keys;
fassert(50996, internalAuthKeys.size() > 0);
@@ -200,24 +200,24 @@ void setInternalAuthKeys(const std::vector<std::string>& keys) {
}
void setInternalUserAuthParams(BSONObj obj) {
- stdx::lock_guard<stdx::mutex> lk(internalAuthKeysMutex);
+ stdx::lock_guard<Latch> lk(internalAuthKeysMutex);
internalAuthParams = obj.getOwned();
internalAuthKeys.clear();
internalAuthSet = true;
}
bool hasMultipleInternalAuthKeys() {
- stdx::lock_guard<stdx::mutex> lk(internalAuthKeysMutex);
+ stdx::lock_guard<Latch> lk(internalAuthKeysMutex);
return internalAuthSet && internalAuthKeys.size() > 1;
}
bool isInternalAuthSet() {
- stdx::lock_guard<stdx::mutex> lk(internalAuthKeysMutex);
+ stdx::lock_guard<Latch> lk(internalAuthKeysMutex);
return internalAuthSet;
}
BSONObj getInternalAuthParams(size_t idx, const std::string& mechanism) {
- stdx::lock_guard<stdx::mutex> lk(internalAuthKeysMutex);
+ stdx::lock_guard<Latch> lk(internalAuthKeysMutex);
if (!internalAuthSet) {
return BSONObj();
}