summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/mock
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-02-27 18:33:28 -0500
committerAndy Schwerin <schwerin@mongodb.com>2015-03-12 17:11:20 -0400
commit7cd9cf303c824478f0f6d60cadfcc1a25bdb21f2 (patch)
treeebeec8c3c2dc21359b941d95e2109e355542e65f /src/mongo/dbtests/mock
parent7ee3d124070db157181bc1b24f2b84913957c388 (diff)
downloadmongo-7cd9cf303c824478f0f6d60cadfcc1a25bdb21f2.tar.gz
SERVER-17310 Make mongo::mutex a typedef of boost::mutex and remove mongo::scoped_lock.
Diffstat (limited to 'src/mongo/dbtests/mock')
-rw-r--r--src/mongo/dbtests/mock/mock_conn_registry.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mongo/dbtests/mock/mock_conn_registry.cpp b/src/mongo/dbtests/mock/mock_conn_registry.cpp
index c50e177667f..92f1382c542 100644
--- a/src/mongo/dbtests/mock/mock_conn_registry.cpp
+++ b/src/mongo/dbtests/mock/mock_conn_registry.cpp
@@ -46,10 +46,7 @@ namespace mongo {
return Status::OK();
}
- MockConnRegistry::MockConnRegistry():
- _mockConnStrHook(this),
- _registryMutex("mockConnRegistryMutex") {
- }
+ MockConnRegistry::MockConnRegistry() : _mockConnStrHook(this) {}
MockConnRegistry* MockConnRegistry::get() {
return _instance.get();
@@ -60,7 +57,7 @@ namespace mongo {
}
void MockConnRegistry::addServer(MockRemoteDBServer* server) {
- scoped_lock sl(_registryMutex);
+ boost::lock_guard<boost::mutex> sl(_registryMutex);
const std::string hostName(server->getServerAddress());
fassert(16533, _registry.count(hostName) == 0);
@@ -69,17 +66,17 @@ namespace mongo {
}
bool MockConnRegistry::removeServer(const std::string& hostName) {
- scoped_lock sl(_registryMutex);
+ boost::lock_guard<boost::mutex> sl(_registryMutex);
return _registry.erase(hostName) == 1;
}
void MockConnRegistry::clear() {
- scoped_lock sl(_registryMutex);
+ boost::lock_guard<boost::mutex> sl(_registryMutex);
_registry.clear();
}
MockDBClientConnection* MockConnRegistry::connect(const std::string& connStr) {
- scoped_lock sl(_registryMutex);
+ boost::lock_guard<boost::mutex> sl(_registryMutex);
fassert(16534, _registry.count(connStr) == 1);
return new MockDBClientConnection(_registry[connStr], true);
}