From 0fd6fd9ae6e6dff2d24aec2b69156779252d1d49 Mon Sep 17 00:00:00 2001 From: Guantao Liu <guantaol@google.com> Date: Thu, 17 Oct 2019 13:44:17 -0700 Subject: [PATCH 1/2] Remove an unused parameter in ThreadPoolWorker. --- src/core/lib/iomgr/executor/threadpool.cc | 2 +- src/core/lib/iomgr/executor/threadpool.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/lib/iomgr/executor/threadpool.cc b/src/core/lib/iomgr/executor/threadpool.cc index e203252ef08..6a562d5256f 100644 --- a/src/core/lib/iomgr/executor/threadpool.cc +++ b/src/core/lib/iomgr/executor/threadpool.cc @@ -59,7 +59,7 @@ void ThreadPool::SharedThreadPoolConstructor() { gpr_zalloc(num_threads_ * sizeof(ThreadPoolWorker*))); for (int i = 0; i < num_threads_; ++i) { threads_[i] = - New<ThreadPoolWorker>(thd_name_, this, queue_, thread_options_, i); + New<ThreadPoolWorker>(thd_name_, queue_, thread_options_, i); threads_[i]->Start(); } } diff --git a/src/core/lib/iomgr/executor/threadpool.h b/src/core/lib/iomgr/executor/threadpool.h index 0402c6ddf0e..01a00c025f0 100644 --- a/src/core/lib/iomgr/executor/threadpool.h +++ b/src/core/lib/iomgr/executor/threadpool.h @@ -62,9 +62,8 @@ class ThreadPoolInterface { // NULL closure. class ThreadPoolWorker { public: - ThreadPoolWorker(const char* thd_name, ThreadPoolInterface* pool, - MPMCQueueInterface* queue, Thread::Options& options, - int index) + ThreadPoolWorker(const char* thd_name, MPMCQueueInterface* queue, + Thread::Options& options, int index) : queue_(queue), thd_name_(thd_name), index_(index) { thd_ = Thread(thd_name, [](void* th) { static_cast<ThreadPoolWorker*>(th)->Run(); }, From d3e2e48eccabdfbc1c2a616c50a4c090e30384dc Mon Sep 17 00:00:00 2001 From: Guantao Liu <guantaol@google.com> Date: Thu, 17 Oct 2019 13:45:49 -0700 Subject: [PATCH 2/2] Clang format. --- src/core/lib/iomgr/executor/threadpool.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/lib/iomgr/executor/threadpool.cc b/src/core/lib/iomgr/executor/threadpool.cc index 6a562d5256f..8c9fd18380e 100644 --- a/src/core/lib/iomgr/executor/threadpool.cc +++ b/src/core/lib/iomgr/executor/threadpool.cc @@ -58,8 +58,7 @@ void ThreadPool::SharedThreadPoolConstructor() { threads_ = static_cast<ThreadPoolWorker**>( gpr_zalloc(num_threads_ * sizeof(ThreadPoolWorker*))); for (int i = 0; i < num_threads_; ++i) { - threads_[i] = - New<ThreadPoolWorker>(thd_name_, queue_, thread_options_, i); + threads_[i] = New<ThreadPoolWorker>(thd_name_, queue_, thread_options_, i); threads_[i]->Start(); } }