diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2022-09-22 06:30:32 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-22 07:02:51 +0000 |
commit | 25749cbec3d1e8244276a592e3a3dfdb333c061a (patch) | |
tree | 9eacdbf920193f45b057df433238faaf01df1e25 /src/mongo/transport/service_executor_utils.cpp | |
parent | c99b24eef4cd1e7e86548f311c06c358ade021c4 (diff) | |
download | mongo-25749cbec3d1e8244276a592e3a3dfdb333c061a.tar.gz |
SERVER-69570 ServiceExecutorSynchronous optimizations
Diffstat (limited to 'src/mongo/transport/service_executor_utils.cpp')
-rw-r--r-- | src/mongo/transport/service_executor_utils.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/mongo/transport/service_executor_utils.cpp b/src/mongo/transport/service_executor_utils.cpp index 6b37efcd383..96b03bdf989 100644 --- a/src/mongo/transport/service_executor_utils.cpp +++ b/src/mongo/transport/service_executor_utils.cpp @@ -27,9 +27,6 @@ * it in the license file. */ - -#include "mongo/platform/basic.h" - #include "mongo/transport/service_executor_utils.h" #include <fmt/format.h> @@ -56,11 +53,11 @@ #define __has_feature(x) 0 #endif -using namespace fmt::literals; - -namespace mongo { +namespace mongo::transport { namespace { +using namespace fmt::literals; + void* runFunc(void* ctx) { auto taskPtr = std::unique_ptr<unique_function<void()>>(static_cast<unique_function<void()>*>(ctx)); @@ -70,7 +67,7 @@ void* runFunc(void* ctx) { } } // namespace -Status launchServiceWorkerThread(unique_function<void()> task) noexcept { +Status launchServiceWorkerThread(unique_function<void()> task) { try { #if defined(_WIN32) @@ -160,9 +157,9 @@ Status launchServiceWorkerThread(unique_function<void()> task) noexcept { return Status::OK(); } -void scheduleCallbackOnDataAvailable(const transport::SessionHandle& session, +void scheduleCallbackOnDataAvailable(const SessionHandle& session, unique_function<void(Status)> callback, - transport::ServiceExecutor* executor) noexcept { + ServiceExecutor* executor) { invariant(session); executor->schedule([session, callback = std::move(callback), executor](Status status) { executor->yieldIfAppropriate(); @@ -176,4 +173,4 @@ void scheduleCallbackOnDataAvailable(const transport::SessionHandle& session, }); } -} // namespace mongo +} // namespace mongo::transport |