diff options
author | vskipin <vskipin@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
commit | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (patch) | |
tree | a7a5543d815c451256ece74081d960b4e1d70ec2 /contrib/libs/grpc | |
parent | 5b00ed04a5137a452fa6d3423cb0c9b54ac27408 (diff) | |
download | ydb-4e4b78bd7b67e2533da4dbb9696374a6d6068e32.tar.gz |
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/grpc')
-rw-r--r-- | contrib/libs/grpc/src/core/lib/iomgr/executor.cc | 22 | ||||
-rw-r--r-- | contrib/libs/grpc/src/core/lib/iomgr/executor.h | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor.cc b/contrib/libs/grpc/src/core/lib/iomgr/executor.cc index 10b2f948ec..40e94b79c6 100644 --- a/contrib/libs/grpc/src/core/lib/iomgr/executor.cc +++ b/contrib/libs/grpc/src/core/lib/iomgr/executor.cc @@ -85,8 +85,8 @@ const EnqueueFunc {{default_enqueue_short, default_enqueue_long}, {resolver_enqueue_short, resolver_enqueue_long}}; -size_t threads_limit_ = 0; - +size_t threads_limit_ = 0; + } // namespace TraceFlag executor_trace(false, "executor"); @@ -95,17 +95,17 @@ Executor::Executor(const char* name) : name_(name) { adding_thread_lock_ = GPR_SPINLOCK_STATIC_INITIALIZER; gpr_atm_rel_store(&num_threads_, 0); max_threads_ = GPR_MAX(1, 2 * gpr_cpu_num_cores()); - if (threads_limit_) { - max_threads_ = GPR_MIN(max_threads_, threads_limit_); - } -} - -size_t Executor::SetThreadsLimit(size_t count) { - size_t prev = threads_limit_; - threads_limit_ = count; - return prev; + if (threads_limit_) { + max_threads_ = GPR_MIN(max_threads_, threads_limit_); + } } +size_t Executor::SetThreadsLimit(size_t count) { + size_t prev = threads_limit_; + threads_limit_ = count; + return prev; +} + void Executor::Init() { SetThreading(true); } size_t Executor::RunClosures(const char* executor_name, diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor.h b/contrib/libs/grpc/src/core/lib/iomgr/executor.h index ae523ff212..6a51e17532 100644 --- a/contrib/libs/grpc/src/core/lib/iomgr/executor.h +++ b/contrib/libs/grpc/src/core/lib/iomgr/executor.h @@ -103,9 +103,9 @@ class Executor { // Return if the DEFAULT executor is threaded static bool IsThreadedDefault(); - // Set the maximum numbers of executor treads - static size_t SetThreadsLimit(size_t count); - + // Set the maximum numbers of executor treads + static size_t SetThreadsLimit(size_t count); + private: static size_t RunClosures(const char* executor_name, grpc_closure_list list); static void ThreadMain(void* arg); |