diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-11-09 17:46:29 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-11-09 17:46:29 -0800 |
commit | 4e9265c828f0b559b5fdba04913fed46bf771399 (patch) | |
tree | 4a379fc2bdc037753cf8d81f8b86327e4bc50a42 /test/cpp/microbenchmarks/bm_cq.cc | |
parent | 0ee7574732a06e8cace4e099a678f4bd5dbff679 (diff) | |
parent | d9da7387b8057f3bd99a417a5ee905377bce9296 (diff) |
Merge with master
Diffstat (limited to 'test/cpp/microbenchmarks/bm_cq.cc')
-rw-r--r-- | test/cpp/microbenchmarks/bm_cq.cc | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index 2fd2ba23c0..8cf7823a94 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -26,9 +26,7 @@ #include <grpc/support/log.h> #include "test/cpp/microbenchmarks/helpers.h" -extern "C" { #include "src/core/lib/surface/completion_queue.h" -} namespace grpc { namespace testing { @@ -67,10 +65,10 @@ 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 CompletionQueueTag { +class DummyTag final : public internal::CompletionQueueTag { public: bool FinalizeResult(void** tag, bool* status) override { return true; } }; @@ -84,9 +82,9 @@ static void BM_Pass1Cpp(benchmark::State& state) { DummyTag dummy_tag; ExecCtx _local_exec_ctx; GPR_ASSERT(grpc_cq_begin_op(c_cq, &dummy_tag)); - grpc_cq_end_op(c_cq, &dummy_tag, GRPC_ERROR_NONE, DoneWithCompletionOnStack, - NULL, &completion); - grpc_exec_ctx_finish(); + grpc_cq_end_op(&exec_ctx, c_cq, &dummy_tag, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, NULL, &completion); + grpc_exec_ctx_finish(&exec_ctx); void* tag; bool ok; cq.Next(&tag, &ok); @@ -104,9 +102,9 @@ static void BM_Pass1Core(benchmark::State& state) { grpc_cq_completion completion; ExecCtx _local_exec_ctx; GPR_ASSERT(grpc_cq_begin_op(cq, NULL)); - grpc_cq_end_op(cq, NULL, GRPC_ERROR_NONE, DoneWithCompletionOnStack, NULL, - &completion); - grpc_exec_ctx_finish(); + grpc_cq_end_op(&exec_ctx, cq, NULL, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, NULL, &completion); + grpc_exec_ctx_finish(&exec_ctx); grpc_completion_queue_next(cq, deadline, NULL); } grpc_completion_queue_destroy(cq); @@ -123,9 +121,9 @@ static void BM_Pluck1Core(benchmark::State& state) { grpc_cq_completion completion; ExecCtx _local_exec_ctx; GPR_ASSERT(grpc_cq_begin_op(cq, NULL)); - grpc_cq_end_op(cq, NULL, GRPC_ERROR_NONE, DoneWithCompletionOnStack, NULL, - &completion); - grpc_exec_ctx_finish(); + grpc_cq_end_op(&exec_ctx, cq, NULL, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, NULL, &completion); + grpc_exec_ctx_finish(&exec_ctx); grpc_completion_queue_pluck(cq, NULL, deadline, NULL); } grpc_completion_queue_destroy(cq); |