Reviewer comments

pull/21119/head
Yash Tibrewal 5 years ago
parent 61020b55f9
commit 79aa21fa71
  1. 9
      src/core/lib/iomgr/exec_ctx.cc
  2. 4
      test/cpp/microbenchmarks/bm_chttp2_transport.cc
  3. 2
      test/cpp/microbenchmarks/bm_closure.cc
  4. 2
      test/cpp/microbenchmarks/bm_pollset.cc

@ -180,11 +180,10 @@ void ExecCtx::Run(const DebugLocation& location, grpc_closure* closure,
if (closure->scheduled) {
gpr_log(GPR_ERROR,
"Closure already scheduled. (closure: %p, created: [%s:%d], "
"previously scheduled at: [%s: %d], newly scheduled at [%s: %d], "
"run?: %s",
"previously scheduled at: [%s: %d], newly scheduled at [%s: %d]",
closure, closure->file_created, closure->line_created,
closure->file_initiated, closure->line_initiated, location.file(),
location.line(), closure->run ? "true" : "false");
location.line());
abort();
}
closure->scheduled = true;
@ -205,9 +204,9 @@ void ExecCtx::RunList(const DebugLocation& location, grpc_closure_list* list) {
if (c->scheduled) {
gpr_log(GPR_ERROR,
"Closure already scheduled. (closure: %p, created: [%s:%d], "
"previously scheduled at: [%s: %d] run?: %s",
"previously scheduled at: [%s: %d], newly scheduled at [%s:%d]",
c, c->file_created, c->line_created, c->file_initiated,
c->line_initiated, c->run ? "true" : "false");
c->line_initiated, location.file(), location.line());
abort();
}
c->scheduled = true;

@ -162,7 +162,9 @@ class Closure : public grpc_closure {
template <class F>
std::unique_ptr<Closure> MakeClosure(F f) {
struct C : public Closure {
C(const F& f) : f_(f) { GRPC_CLOSURE_INIT(this, Execute, this, nullptr); }
explicit C(const F& f) : f_(f) {
GRPC_CLOSURE_INIT(this, Execute, this, nullptr);
}
F f_;
static void Execute(void* arg, grpc_error* error) {
static_cast<C*>(arg)->f_(error);

@ -350,7 +350,7 @@ BENCHMARK(BM_ClosureSched4OnTwoCombiners);
// the benchmark is complete
class Rescheduler {
public:
Rescheduler(benchmark::State& state) : state_(state) {
explicit Rescheduler(benchmark::State& state) : state_(state) {
GRPC_CLOSURE_INIT(&closure_, Step, this, nullptr);
}

@ -165,7 +165,7 @@ class Closure : public grpc_closure {
template <class F>
Closure* MakeClosure(F f) {
struct C : public Closure {
C(F f) : f_(f) { GRPC_CLOSURE_INIT(this, C::cbfn, this, nullptr); }
explicit C(F f) : f_(f) { GRPC_CLOSURE_INIT(this, C::cbfn, this, nullptr); }
static void cbfn(void* arg, grpc_error* /*error*/) {
C* p = static_cast<C*>(arg);
p->f_();

Loading…
Cancel
Save