diff options
Diffstat (limited to 'src/mongo/transport')
5 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/transport/baton_asio_linux.h b/src/mongo/transport/baton_asio_linux.h index becc205cd2b..19cebe3ae3a 100644 --- a/src/mongo/transport/baton_asio_linux.h +++ b/src/mongo/transport/baton_asio_linux.h @@ -289,7 +289,7 @@ public: std::vector<Promise<void>> toFulfill; // We'll fulfill promises and run jobs on the way out, ensuring we don't hold any locks - const auto guard = makeGuard([&] { + const ScopeGuard guard([&] { for (auto& promise : toFulfill) { promise.emplaceValue(); } diff --git a/src/mongo/transport/service_executor_reserved.cpp b/src/mongo/transport/service_executor_reserved.cpp index 4a086efb01d..e8745d9e5f7 100644 --- a/src/mongo/transport/service_executor_reserved.cpp +++ b/src/mongo/transport/service_executor_reserved.cpp @@ -100,7 +100,7 @@ Status ServiceExecutorReserved::_startWorker() { return launchServiceWorkerThread([this] { stdx::unique_lock<Latch> lk(_mutex); _numRunningWorkerThreads.addAndFetch(1); - auto numRunningGuard = makeGuard([&] { + ScopeGuard numRunningGuard([&] { _numRunningWorkerThreads.subtractAndFetch(1); _shutdownCondition.notify_one(); }); diff --git a/src/mongo/transport/service_executor_test.cpp b/src/mongo/transport/service_executor_test.cpp index 1b93c7d8280..303063d22b1 100644 --- a/src/mongo/transport/service_executor_test.cpp +++ b/src/mongo/transport/service_executor_test.cpp @@ -277,7 +277,7 @@ TEST_F(ServiceExecutorFixedTest, ScheduleSucceedsBeforeShutdown) { handle.start(); stdx::thread scheduleClient; - auto joinGuard = makeGuard([&] { scheduleClient.join(); }); + ScopeGuard joinGuard([&] { scheduleClient.join(); }); { FailPointEnableBlock failpoint("hangBeforeSchedulingServiceExecutorFixedTask"); diff --git a/src/mongo/transport/service_executor_utils.cpp b/src/mongo/transport/service_executor_utils.cpp index 13cba5d994d..f4382074734 100644 --- a/src/mongo/transport/service_executor_utils.cpp +++ b/src/mongo/transport/service_executor_utils.cpp @@ -75,7 +75,7 @@ Status launchServiceWorkerThread(unique_function<void()> task) noexcept { #else pthread_attr_t attrs; pthread_attr_init(&attrs); - auto attrsGuard = makeGuard([&attrs] { pthread_attr_destroy(&attrs); }); + ScopeGuard attrsGuard([&attrs] { pthread_attr_destroy(&attrs); }); pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED); static const rlim_t kStackSize = diff --git a/src/mongo/transport/transport_layer_asio_integration_test.cpp b/src/mongo/transport/transport_layer_asio_integration_test.cpp index 2b8fea1f8f5..9f6eafa21ad 100644 --- a/src/mongo/transport/transport_layer_asio_integration_test.cpp +++ b/src/mongo/transport/transport_layer_asio_integration_test.cpp @@ -110,7 +110,7 @@ TEST(TransportLayerASIO, ShortReadsAndWritesWork) { auto reactor = sc->getTransportLayer()->getReactor(transport::TransportLayer::kNewReactor); stdx::thread thread([&] { reactor->run(); }); - const auto threadGuard = makeGuard([&] { + const ScopeGuard threadGuard([&] { reactor->stop(); thread.join(); }); @@ -143,7 +143,7 @@ TEST(TransportLayerASIO, asyncConnectTimeoutCleansUpSocket) { stdx::thread thread([&] { reactor->run(); }); - const auto threadGuard = makeGuard([&] { + const ScopeGuard threadGuard([&] { reactor->stop(); thread.join(); }); @@ -163,7 +163,7 @@ TEST(TransportLayerASIO, exhaustIsMasterShouldReceiveMultipleReplies) { auto reactor = sc->getTransportLayer()->getReactor(transport::TransportLayer::kNewReactor); stdx::thread thread([&] { reactor->run(); }); - const auto threadGuard = makeGuard([&] { + const ScopeGuard threadGuard([&] { reactor->stop(); thread.join(); }); @@ -245,7 +245,7 @@ TEST(TransportLayerASIO, exhaustIsMasterShouldStopOnFailure) { auto reactor = sc->getTransportLayer()->getReactor(transport::TransportLayer::kNewReactor); stdx::thread thread([&] { reactor->run(); }); - const auto threadGuard = makeGuard([&] { + const ScopeGuard threadGuard([&] { reactor->stop(); thread.join(); }); |