From ad4d2dde0052efbbf49d64b0843c45f0381cfeb3 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 6 Dec 2017 09:05:05 -0800 Subject: Revert "All instances of exec_ctx being passed around in src/core removed" --- test/cpp/microbenchmarks/bm_cq.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'test/cpp/microbenchmarks/bm_cq.cc') diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index 97242598f1..f0dede7333 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -66,7 +66,7 @@ static void BM_CreateDestroyCore(benchmark::State& state) { } BENCHMARK(BM_CreateDestroyCore); -static void DoneWithCompletionOnStack(void* arg, +static void DoneWithCompletionOnStack(grpc_exec_ctx* exec_ctx, void* arg, grpc_cq_completion* completion) {} class DummyTag final : public internal::CompletionQueueTag { @@ -81,11 +81,11 @@ static void BM_Pass1Cpp(benchmark::State& state) { while (state.KeepRunning()) { grpc_cq_completion completion; DummyTag dummy_tag; - grpc_core::ExecCtx exec_ctx; + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GPR_ASSERT(grpc_cq_begin_op(c_cq, &dummy_tag)); - grpc_cq_end_op(c_cq, &dummy_tag, GRPC_ERROR_NONE, DoneWithCompletionOnStack, - nullptr, &completion); - + grpc_cq_end_op(&exec_ctx, c_cq, &dummy_tag, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, nullptr, &completion); + grpc_exec_ctx_finish(&exec_ctx); void* tag; bool ok; cq.Next(&tag, &ok); @@ -101,11 +101,11 @@ static void BM_Pass1Core(benchmark::State& state) { gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; - grpc_core::ExecCtx exec_ctx; + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GPR_ASSERT(grpc_cq_begin_op(cq, nullptr)); - grpc_cq_end_op(cq, nullptr, GRPC_ERROR_NONE, DoneWithCompletionOnStack, - nullptr, &completion); - + grpc_cq_end_op(&exec_ctx, cq, nullptr, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, nullptr, &completion); + grpc_exec_ctx_finish(&exec_ctx); grpc_completion_queue_next(cq, deadline, nullptr); } grpc_completion_queue_destroy(cq); @@ -120,11 +120,11 @@ static void BM_Pluck1Core(benchmark::State& state) { gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; - grpc_core::ExecCtx exec_ctx; + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GPR_ASSERT(grpc_cq_begin_op(cq, nullptr)); - grpc_cq_end_op(cq, nullptr, GRPC_ERROR_NONE, DoneWithCompletionOnStack, - nullptr, &completion); - + grpc_cq_end_op(&exec_ctx, cq, nullptr, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, nullptr, &completion); + grpc_exec_ctx_finish(&exec_ctx); grpc_completion_queue_pluck(cq, nullptr, deadline, nullptr); } grpc_completion_queue_destroy(cq); -- cgit v1.2.3