diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-12-06 09:05:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-06 09:05:05 -0800 |
commit | ad4d2dde0052efbbf49d64b0843c45f0381cfeb3 (patch) | |
tree | 6a657f8c6179d873b34505cdc24bce9462ca68eb /test/cpp/microbenchmarks/bm_cq_multiple_threads.cc | |
parent | a3df36cc2505a89c2f481eea4a66a87b3002844a (diff) |
Revert "All instances of exec_ctx being passed around in src/core removed"
Diffstat (limited to 'test/cpp/microbenchmarks/bm_cq_multiple_threads.cc')
-rw-r--r-- | test/cpp/microbenchmarks/bm_cq_multiple_threads.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc index 874c834931..7ccebb55ee 100644 --- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc +++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc @@ -43,8 +43,9 @@ static grpc_completion_queue* g_cq; static grpc_event_engine_vtable g_vtable; static const grpc_event_engine_vtable* g_old_vtable; -static void pollset_shutdown(grpc_pollset* ps, grpc_closure* closure) { - GRPC_CLOSURE_SCHED(closure, GRPC_ERROR_NONE); +static void pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* ps, + grpc_closure* closure) { + GRPC_CLOSURE_SCHED(exec_ctx, closure, GRPC_ERROR_NONE); } static void pollset_init(grpc_pollset* ps, gpr_mu** mu) { @@ -52,20 +53,25 @@ static void pollset_init(grpc_pollset* ps, gpr_mu** mu) { *mu = &ps->mu; } -static void pollset_destroy(grpc_pollset* ps) { gpr_mu_destroy(&ps->mu); } +static void pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* ps) { + gpr_mu_destroy(&ps->mu); +} -static grpc_error* pollset_kick(grpc_pollset* p, grpc_pollset_worker* worker) { +static grpc_error* pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* p, + grpc_pollset_worker* worker) { return GRPC_ERROR_NONE; } /* Callback when the tag is dequeued from the completion queue. Does nothing */ -static void cq_done_cb(void* done_arg, grpc_cq_completion* cq_completion) { +static void cq_done_cb(grpc_exec_ctx* exec_ctx, void* done_arg, + grpc_cq_completion* cq_completion) { gpr_free(cq_completion); } /* Queues a completion tag if deadline is > 0. * Does nothing if deadline is 0 (i.e gpr_time_0(GPR_CLOCK_MONOTONIC)) */ -static grpc_error* pollset_work(grpc_pollset* ps, grpc_pollset_worker** worker, +static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* ps, + grpc_pollset_worker** worker, grpc_millis deadline) { if (deadline == 0) { gpr_log(GPR_DEBUG, "no-op"); @@ -74,9 +80,9 @@ static grpc_error* pollset_work(grpc_pollset* ps, grpc_pollset_worker** worker, gpr_mu_unlock(&ps->mu); GPR_ASSERT(grpc_cq_begin_op(g_cq, g_tag)); - grpc_cq_end_op(g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, nullptr, + grpc_cq_end_op(exec_ctx, g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, nullptr, (grpc_cq_completion*)gpr_malloc(sizeof(grpc_cq_completion))); - grpc_core::ExecCtx::Get()->Flush(); + grpc_exec_ctx_flush(exec_ctx); gpr_mu_lock(&ps->mu); return GRPC_ERROR_NONE; } |