summaryrefslogtreecommitdiff
path: root/src/mongo/util/net/ssl_manager_openssl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/util/net/ssl_manager_openssl.cpp')
-rw-r--r--src/mongo/util/net/ssl_manager_openssl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/util/net/ssl_manager_openssl.cpp b/src/mongo/util/net/ssl_manager_openssl.cpp
index f3933dc640f..864e55d40f1 100644
--- a/src/mongo/util/net/ssl_manager_openssl.cpp
+++ b/src/mongo/util/net/ssl_manager_openssl.cpp
@@ -346,7 +346,7 @@ private:
class ThreadIDManager {
public:
unsigned long reserveID() {
- stdx::unique_lock<stdx::mutex> lock(_idMutex);
+ stdx::unique_lock<Latch> lock(_idMutex);
if (!_idLast.empty()) {
unsigned long ret = _idLast.top();
_idLast.pop();
@@ -356,13 +356,14 @@ private:
}
void releaseID(unsigned long id) {
- stdx::unique_lock<stdx::mutex> lock(_idMutex);
+ stdx::unique_lock<Latch> lock(_idMutex);
_idLast.push(id);
}
private:
// Machinery for producing IDs that are unique for the life of a thread.
- stdx::mutex _idMutex; // Protects _idNext and _idLast.
+ Mutex _idMutex =
+ MONGO_MAKE_LATCH("ThreadIDManager::_idMutex"); // Protects _idNext and _idLast.
unsigned long _idNext = 0; // Stores the next thread ID to use, if none already allocated.
std::stack<unsigned long, std::vector<unsigned long>>
_idLast; // Stores old thread IDs, for reuse.
@@ -476,7 +477,7 @@ private:
/** Either returns a cached password, or prompts the user to enter one. */
StatusWith<StringData> fetchPassword() {
- stdx::lock_guard<stdx::mutex> lock(_mutex);
+ stdx::lock_guard<Latch> lock(_mutex);
if (_password->size()) {
return StringData(_password->c_str());
}
@@ -501,7 +502,7 @@ private:
}
private:
- stdx::mutex _mutex;
+ Mutex _mutex = MONGO_MAKE_LATCH("PasswordFetcher::_mutex");
SecureString _password; // Protected by _mutex
std::string _prompt;