summaryrefslogtreecommitdiff
path: root/src/mongo/embedded
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2021-09-03 19:11:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-08 07:54:48 +0000
commitc90f38192378c8526354465991830524eda90c1f (patch)
tree73ce6a76f4dc6f8eaa206309becf5881aaf20a32 /src/mongo/embedded
parenta0a0d7eecccf38f028a77c4cc8b0f13f8673f675 (diff)
downloadmongo-c90f38192378c8526354465991830524eda90c1f.tar.gz
SERVER-59782 migrate makeGuard calls to ScopeGuard
Diffstat (limited to 'src/mongo/embedded')
-rw-r--r--src/mongo/embedded/embedded.cpp4
-rw-r--r--src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp2
-rw-r--r--src/mongo/embedded/stitch_support/stitch_support_test.cpp1
3 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/embedded/embedded.cpp b/src/mongo/embedded/embedded.cpp
index c08fde3c60a..c6692fbee6b 100644
--- a/src/mongo/embedded/embedded.cpp
+++ b/src/mongo/embedded/embedded.cpp
@@ -195,12 +195,12 @@ ServiceContext* initialize(const char* yaml_config) {
Status status = mongo::runGlobalInitializers(std::vector<std::string>{});
uassertStatusOKWithContext(status, "Global initilization failed");
- auto giGuard = makeGuard([] { mongo::runGlobalDeinitializers().ignore(); });
+ ScopeGuard giGuard([] { mongo::runGlobalDeinitializers().ignore(); });
setGlobalServiceContext(ServiceContext::make());
Client::initThread("initandlisten");
// Make sure current thread have no client set in thread_local when we leave this function
- auto clientGuard = makeGuard([] { Client::releaseCurrent(); });
+ ScopeGuard clientGuard([] { Client::releaseCurrent(); });
auto serviceContext = getGlobalServiceContext();
serviceContext->setServiceEntryPoint(std::make_unique<ServiceEntryPointEmbedded>());
diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
index 955fbf62fff..3785a11754e 100644
--- a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
+++ b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp
@@ -387,7 +387,7 @@ TEST_F(MongodbCAPITest, KillOp) {
ASSERT(outputBSON.getField("ok").numberDouble() == 1.0);
});
- auto guard = mongo::makeGuard([&] { killOpThread.join(); });
+ mongo::ScopeGuard guard = [&] { killOpThread.join(); };
mongo::BSONObj sleepObj = mongo::fromjson("{'sleep': {'secs': 1000}}");
auto sleepOpMsg = mongo::OpMsgRequest::fromDBAndBody("admin", sleepObj);
diff --git a/src/mongo/embedded/stitch_support/stitch_support_test.cpp b/src/mongo/embedded/stitch_support/stitch_support_test.cpp
index d8984f43367..0b2807c9d02 100644
--- a/src/mongo/embedded/stitch_support/stitch_support_test.cpp
+++ b/src/mongo/embedded/stitch_support/stitch_support_test.cpp
@@ -41,7 +41,6 @@
namespace {
-using mongo::makeGuard;
using mongo::ScopeGuard;
class StitchSupportTest : public mongo::unittest::Test {