diff options
author | Vijay Pai <vpai@google.com> | 2015-08-13 15:03:46 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-08-13 15:03:46 -0700 |
commit | d9c1bc7281cac61472ba2cd6d39c1d5b878cc3bc (patch) | |
tree | 95fb3e7d33b7eda69131d6b46605d251871cb78d /src/cpp/common/completion_queue.cc | |
parent | ed48bf8f71efce4a9037a74ae9ab2c83a3e9b4a7 (diff) | |
parent | f123443aa524bf42d3d23a834e0ae33d57ed8648 (diff) |
Merge pull request #2612 from nicolasnoble/the-ultimate-showdown
Adding reserved arguments and pointers in the API to ensure stability.
Diffstat (limited to 'src/cpp/common/completion_queue.cc')
-rw-r--r-- | src/cpp/common/completion_queue.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue.cc index 593963f672..fca33f8f54 100644 --- a/src/cpp/common/completion_queue.cc +++ b/src/cpp/common/completion_queue.cc @@ -40,7 +40,9 @@ namespace grpc { -CompletionQueue::CompletionQueue() { cq_ = grpc_completion_queue_create(); } +CompletionQueue::CompletionQueue() { + cq_ = grpc_completion_queue_create(nullptr); +} CompletionQueue::CompletionQueue(grpc_completion_queue* take) : cq_(take) {} @@ -51,7 +53,7 @@ void CompletionQueue::Shutdown() { grpc_completion_queue_shutdown(cq_); } CompletionQueue::NextStatus CompletionQueue::AsyncNextInternal( void** tag, bool* ok, gpr_timespec deadline) { for (;;) { - auto ev = grpc_completion_queue_next(cq_, deadline); + auto ev = grpc_completion_queue_next(cq_, deadline, nullptr); switch (ev.type) { case GRPC_QUEUE_TIMEOUT: return TIMEOUT; @@ -70,8 +72,8 @@ CompletionQueue::NextStatus CompletionQueue::AsyncNextInternal( } bool CompletionQueue::Pluck(CompletionQueueTag* tag) { - auto ev = - grpc_completion_queue_pluck(cq_, tag, gpr_inf_future(GPR_CLOCK_REALTIME)); + auto deadline = gpr_inf_future(GPR_CLOCK_REALTIME); + auto ev = grpc_completion_queue_pluck(cq_, tag, deadline, nullptr); bool ok = ev.success != 0; void* ignored = tag; GPR_ASSERT(tag->FinalizeResult(&ignored, &ok)); @@ -81,8 +83,8 @@ bool CompletionQueue::Pluck(CompletionQueueTag* tag) { } void CompletionQueue::TryPluck(CompletionQueueTag* tag) { - auto ev = - grpc_completion_queue_pluck(cq_, tag, gpr_time_0(GPR_CLOCK_REALTIME)); + auto deadline = gpr_time_0(GPR_CLOCK_REALTIME); + auto ev = grpc_completion_queue_pluck(cq_, tag, deadline, nullptr); if (ev.type == GRPC_QUEUE_TIMEOUT) return; bool ok = ev.success != 0; void* ignored = tag; |