diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2018-11-01 18:51:15 -0400 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2018-11-08 18:35:00 -0500 |
commit | aff889b39301472bd2143967938a3dba468dfc63 (patch) | |
tree | 2ee4fcec926d96a674690e390d5b916b4b9c7a3b /src/mongo/db/storage/test_harness_helper.cpp | |
parent | 4fb38d9c10123321dada6fe1be477f9cb99732a7 (diff) | |
download | mongo-aff889b39301472bd2143967938a3dba468dfc63.tar.gz |
SERVER-36473 Make a dedicated RAII class to manage Client lifetime
Diffstat (limited to 'src/mongo/db/storage/test_harness_helper.cpp')
-rw-r--r-- | src/mongo/db/storage/test_harness_helper.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/mongo/db/storage/test_harness_helper.cpp b/src/mongo/db/storage/test_harness_helper.cpp index aabdfdd7315..2f06d66f359 100644 --- a/src/mongo/db/storage/test_harness_helper.cpp +++ b/src/mongo/db/storage/test_harness_helper.cpp @@ -40,16 +40,7 @@ namespace { stdx::function<std::unique_ptr<HarnessHelper>()> basicHarnessFactory; } // namespace - -HarnessHelper::HarnessHelper() { - setGlobalServiceContext(ServiceContext::make()); - Client::initThread(getThreadName()); -} - -HarnessHelper::~HarnessHelper() { - Client::destroy(); - setGlobalServiceContext({}); -} +HarnessHelper::HarnessHelper() : _threadClient(getGlobalServiceContext()) {} void registerHarnessHelperFactory(stdx::function<std::unique_ptr<HarnessHelper>()> factory) { basicHarnessFactory = std::move(factory); |