diff options
Diffstat (limited to 'src/mongo/db/service_context_d.cpp')
-rw-r--r-- | src/mongo/db/service_context_d.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/service_context_d.cpp b/src/mongo/db/service_context_d.cpp index f1dd329781b..f3e40ee053b 100644 --- a/src/mongo/db/service_context_d.cpp +++ b/src/mongo/db/service_context_d.cpp @@ -40,6 +40,7 @@ #include "mongo/db/concurrency/lock_state.h" #include "mongo/db/op_observer.h" #include "mongo/db/service_context.h" +#include "mongo/db/service_entry_point_mongod.h" #include "mongo/db/storage/storage_engine.h" #include "mongo/db/storage/storage_engine_lock_file.h" #include "mongo/db/storage/storage_engine_metadata.h" @@ -56,14 +57,17 @@ namespace mongo { namespace { - -MONGO_INITIALIZER(SetGlobalEnvironment)(InitializerContext* context) { - setGlobalServiceContext(stdx::make_unique<ServiceContextMongoD>()); - auto service = getGlobalServiceContext(); - +auto makeMongoDServiceContext() { + auto service = stdx::make_unique<ServiceContextMongoD>(); + service->setServiceEntryPoint(stdx::make_unique<ServiceEntryPointMongod>(service.get())); service->setTickSource(stdx::make_unique<SystemTickSource>()); service->setFastClockSource(stdx::make_unique<SystemClockSource>()); service->setPreciseClockSource(stdx::make_unique<SystemClockSource>()); + return service; +} + +MONGO_INITIALIZER(SetGlobalEnvironment)(InitializerContext* context) { + setGlobalServiceContext(makeMongoDServiceContext()); return Status::OK(); } } // namespace |