diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2018-11-12 11:03:22 -0500 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2018-11-12 14:42:43 -0500 |
commit | b16a351ead6ec99e36f18f2d5ae87f0db11ecde5 (patch) | |
tree | 96c1394b0aedb24f175f752aec9227eee8102b69 /src/mongo/tools | |
parent | 8f4f41f29f8b36887829b43946695ccb40144d89 (diff) | |
download | mongo-b16a351ead6ec99e36f18f2d5ae87f0db11ecde5.tar.gz |
SERVER-38093 Use ThreadClient in mongoebench to destruct Client cleanly
Diffstat (limited to 'src/mongo/tools')
-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; }; |