summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2018-04-27 16:09:09 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2018-04-27 17:23:21 -0400
commit2227f272a7a0a3e43625cb2d4a2704e1ccb6f893 (patch)
treeeeb3a3fe22df48b6819a5d7e719befd680b3dedc /src/mongo/db/db_raii.cpp
parent7c25d109bda4c56cc329ee4f1a1521a2f9bc690a (diff)
downloadmongo-2227f272a7a0a3e43625cb2d4a2704e1ccb6f893.tar.gz
SERVER-32645 Create a shim helper framework.
The `MONGO_DECLARE_SHIM`, `MONGO_DEFINE_SHIM`, and `MONGO_REGISTER_SHIM` macros can be used to create specialized types which are customization and auto-registration points for late-binding functions. In some sense they work like weak-symbols; however, they also are useful for tracking dependencies upon shimmed-out implementations.
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp
index dbecb09a07f..59d49c5943b 100644
--- a/src/mongo/db/db_raii.cpp
+++ b/src/mongo/db/db_raii.cpp
@@ -281,7 +281,8 @@ AutoGetCollectionForReadCommand::AutoGetCollectionForReadCommand(
}
OldClientContext::OldClientContext(OperationContext* opCtx, const std::string& ns, bool doVersion)
- : OldClientContext(opCtx, ns, doVersion, dbHolder().get(opCtx, ns), false) {}
+ : OldClientContext(
+ opCtx, ns, doVersion, DatabaseHolder::getDatabaseHolder().get(opCtx, ns), false) {}
OldClientContext::OldClientContext(
OperationContext* opCtx, const std::string& ns, bool doVersion, Database* db, bool justCreated)
@@ -289,7 +290,7 @@ OldClientContext::OldClientContext(
if (!_db) {
const auto dbName = nsToDatabaseSubstring(ns);
invariant(_opCtx->lockState()->isDbLockedForMode(dbName, MODE_X));
- _db = dbHolder().openDb(_opCtx, dbName, &_justCreated);
+ _db = DatabaseHolder::getDatabaseHolder().openDb(_opCtx, dbName, &_justCreated);
invariant(_db);
}