diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2022-07-14 15:44:28 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-14 17:18:10 +0000 |
commit | 4725f9b1fb48e95fd96284ccaa371d08f8cb8b41 (patch) | |
tree | 998471038cdc30b61923bf5b65edefbf4a8cbc24 /src/mongo/transport/service_executor.h | |
parent | 60e0fe845e805e7b23e73ea6e7170572a35806cf (diff) | |
download | mongo-4725f9b1fb48e95fd96284ccaa371d08f8cb8b41.tar.gz |
SERVER-67927 ServiceExecutor: ThreadingModel -> HasDedicatedThread
Diffstat (limited to 'src/mongo/transport/service_executor.h')
-rw-r--r-- | src/mongo/transport/service_executor.h | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/mongo/transport/service_executor.h b/src/mongo/transport/service_executor.h index 56e43b4c404..458f152bd89 100644 --- a/src/mongo/transport/service_executor.h +++ b/src/mongo/transport/service_executor.h @@ -45,26 +45,13 @@ namespace mongo { namespace transport { +extern bool gInitialUseDedicatedThread; + /* * This is the interface for all ServiceExecutors. */ class ServiceExecutor : public OutOfLineExecutor { public: - /** - * An enum to indicate if a ServiceExecutor should use dedicated or borrowed threading - * resources. - */ - enum class ThreadingModel { - kBorrowed, - kDedicated, - }; - - friend StringData toString(ThreadingModel threadingModel); - - static Status setInitialThreadingModelFromString(StringData value) noexcept; - static void setInitialThreadingModel(ThreadingModel threadingModel) noexcept; - static ThreadingModel getInitialThreadingModel() noexcept; - static void shutdownAll(ServiceContext* serviceContext, Date_t deadline); virtual ~ServiceExecutor() = default; @@ -142,8 +129,6 @@ public: */ class ServiceExecutorContext { public: - using ThreadingModel = ServiceExecutor::ThreadingModel; - /** * Get a pointer to the ServiceExecutorContext for a given client. * @@ -173,11 +158,11 @@ public: ServiceExecutorContext& operator=(ServiceExecutorContext&&) = delete; /** - * Set the ThreadingModel for the associated Client's service execution. + * Set the threading model for the associated Client's service execution. * * This function is only valid to invoke with the Client lock or before the Client is set. */ - void setThreadingModel(ThreadingModel threadingModel) noexcept; + void setUseDedicatedThread(bool dedicated) noexcept; /** * Set if reserved resources are available for the associated Client's service execution. @@ -191,8 +176,8 @@ public: * * This function is valid to invoke either on the Client thread or with the Client lock. */ - auto getThreadingModel() const noexcept { - return _threadingModel; + bool useDedicatedThread() const noexcept { + return _useDedicatedThread; } /** @@ -207,7 +192,7 @@ private: Client* _client = nullptr; ServiceEntryPoint* _sep = nullptr; - ThreadingModel _threadingModel = ThreadingModel::kDedicated; + bool _useDedicatedThread = true; bool _canUseReserved = false; bool _hasUsedSynchronous = false; }; |