Fix comment

pull/19695/head
Yunjia Wang 6 years ago
parent efd6946d21
commit d87b5285ca
  1. 12
      test/cpp/microbenchmarks/bm_threadpool.cc

@ -40,7 +40,7 @@ class BlockingCounter {
void DecrementCount() { void DecrementCount() {
std::lock_guard<std::mutex> l(mu_); std::lock_guard<std::mutex> l(mu_);
count_--; count_--;
if (count_ == 0) cv_.notify_one(); if (count_ == 0) cv_.notify_all();
} }
void Wait() { void Wait() {
@ -70,7 +70,6 @@ class AddAnotherFunctor : public grpc_experimental_completion_queue_functor {
internal_next = this; internal_next = this;
internal_success = 0; internal_success = 0;
} }
~AddAnotherFunctor() {}
// When the functor gets to run in thread pool, it will take itself as first // When the functor gets to run in thread pool, it will take itself as first
// argument and internal_success as second one. // argument and internal_success as second one.
static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { static void Run(grpc_experimental_completion_queue_functor* cb, int ok) {
@ -163,7 +162,7 @@ class SuicideFunctorForAdd : public grpc_experimental_completion_queue_functor {
internal_next = this; internal_next = this;
internal_success = 0; internal_success = 0;
} }
~SuicideFunctorForAdd() {}
static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { static void Run(grpc_experimental_completion_queue_functor* cb, int ok) {
// On running, the first argument would be itself. // On running, the first argument would be itself.
auto* callback = static_cast<SuicideFunctorForAdd*>(cb); auto* callback = static_cast<SuicideFunctorForAdd*>(cb);
@ -215,10 +214,8 @@ class AddSelfFunctor : public grpc_experimental_completion_queue_functor {
internal_next = this; internal_next = this;
internal_success = 0; internal_success = 0;
} }
~AddSelfFunctor() {} // When the functor gets to run in thread pool, it will take itself as first
// When the functor gets to run in thread pool, it will take internal_next // argument and internal_success as second one.
// as first argument and internal_success as second one. Therefore, the
// first argument here would be the closure itself.
static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { static void Run(grpc_experimental_completion_queue_functor* cb, int ok) {
auto* callback = static_cast<AddSelfFunctor*>(cb); auto* callback = static_cast<AddSelfFunctor*>(cb);
if (--callback->num_add_ > 0) { if (--callback->num_add_ > 0) {
@ -331,7 +328,6 @@ class ShortWorkFunctorForAdd
internal_success = 0; internal_success = 0;
val_ = 0; val_ = 0;
} }
~ShortWorkFunctorForAdd() {}
static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { static void Run(grpc_experimental_completion_queue_functor* cb, int ok) {
auto* callback = static_cast<ShortWorkFunctorForAdd*>(cb); auto* callback = static_cast<ShortWorkFunctorForAdd*>(cb);
// Uses pad to avoid compiler complaining unused variable error. // Uses pad to avoid compiler complaining unused variable error.

Loading…
Cancel
Save