diff options
-rw-r--r-- | src/mongo/tools/mongoebench_main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/tools/mongoebench_main.cpp b/src/mongo/tools/mongoebench_main.cpp index 0a6c77b4e94..cfe57052c09 100644 --- a/src/mongo/tools/mongoebench_main.cpp +++ b/src/mongo/tools/mongoebench_main.cpp @@ -63,13 +63,14 @@ namespace { */ class DBDirectClientWithOwnOpCtx : public DBDirectClient { public: - DBDirectClientWithOwnOpCtx() : DBDirectClient(nullptr) { - Client::initThreadIfNotAlready(); + DBDirectClientWithOwnOpCtx() + : DBDirectClient(nullptr), _threadClient(getGlobalServiceContext()) { _opCtx = cc().makeOperationContext(); setOpCtx(_opCtx.get()); } private: + ThreadClient _threadClient; ServiceContext::UniqueOperationContext _opCtx; }; |