|
|
@ -529,7 +529,8 @@ grpc_completion_queue* grpc_completion_queue_create_internal( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void cq_init_next( |
|
|
|
static void cq_init_next( |
|
|
|
void* data, grpc_experimental_completion_queue_functor* shutdown_callback) { |
|
|
|
void* data, |
|
|
|
|
|
|
|
grpc_experimental_completion_queue_functor* /*shutdown_callback*/) { |
|
|
|
new (data) cq_next_data(); |
|
|
|
new (data) cq_next_data(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -539,7 +540,8 @@ static void cq_destroy_next(void* data) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void cq_init_pluck( |
|
|
|
static void cq_init_pluck( |
|
|
|
void* data, grpc_experimental_completion_queue_functor* shutdown_callback) { |
|
|
|
void* data, |
|
|
|
|
|
|
|
grpc_experimental_completion_queue_functor* /*shutdown_callback*/) { |
|
|
|
new (data) cq_pluck_data(); |
|
|
|
new (data) cq_pluck_data(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -582,7 +584,7 @@ void grpc_cq_internal_ref(grpc_completion_queue* cq) { |
|
|
|
cq->owning_refs.Ref(debug_location, reason); |
|
|
|
cq->owning_refs.Ref(debug_location, reason); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void on_pollset_shutdown_done(void* arg, grpc_error* error) { |
|
|
|
static void on_pollset_shutdown_done(void* arg, grpc_error* /*error*/) { |
|
|
|
grpc_completion_queue* cq = static_cast<grpc_completion_queue*>(arg); |
|
|
|
grpc_completion_queue* cq = static_cast<grpc_completion_queue*>(arg); |
|
|
|
GRPC_CQ_INTERNAL_UNREF(cq, "pollset_destroy"); |
|
|
|
GRPC_CQ_INTERNAL_UNREF(cq, "pollset_destroy"); |
|
|
|
} |
|
|
|
} |
|
|
@ -630,20 +632,21 @@ static void cq_check_tag(grpc_completion_queue* cq, void* tag, bool lock_cq) { |
|
|
|
GPR_ASSERT(found); |
|
|
|
GPR_ASSERT(found); |
|
|
|
} |
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
static void cq_check_tag(grpc_completion_queue* cq, void* tag, bool lock_cq) {} |
|
|
|
static void cq_check_tag(grpc_completion_queue* /*cq*/, void* /*tag*/, |
|
|
|
|
|
|
|
bool /*lock_cq*/) {} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static bool cq_begin_op_for_next(grpc_completion_queue* cq, void* tag) { |
|
|
|
static bool cq_begin_op_for_next(grpc_completion_queue* cq, void* /*tag*/) { |
|
|
|
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq); |
|
|
|
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq); |
|
|
|
return cqd->pending_events.IncrementIfNonzero(); |
|
|
|
return cqd->pending_events.IncrementIfNonzero(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static bool cq_begin_op_for_pluck(grpc_completion_queue* cq, void* tag) { |
|
|
|
static bool cq_begin_op_for_pluck(grpc_completion_queue* cq, void* /*tag*/) { |
|
|
|
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq); |
|
|
|
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq); |
|
|
|
return cqd->pending_events.IncrementIfNonzero(); |
|
|
|
return cqd->pending_events.IncrementIfNonzero(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static bool cq_begin_op_for_callback(grpc_completion_queue* cq, void* tag) { |
|
|
|
static bool cq_begin_op_for_callback(grpc_completion_queue* cq, void* /*tag*/) { |
|
|
|
cq_callback_data* cqd = static_cast<cq_callback_data*> DATA_FROM_CQ(cq); |
|
|
|
cq_callback_data* cqd = static_cast<cq_callback_data*> DATA_FROM_CQ(cq); |
|
|
|
return cqd->pending_events.IncrementIfNonzero(); |
|
|
|
return cqd->pending_events.IncrementIfNonzero(); |
|
|
|
} |
|
|
|
} |
|
|
@ -669,7 +672,7 @@ bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag) { |
|
|
|
static void cq_end_op_for_next( |
|
|
|
static void cq_end_op_for_next( |
|
|
|
grpc_completion_queue* cq, void* tag, grpc_error* error, |
|
|
|
grpc_completion_queue* cq, void* tag, grpc_error* error, |
|
|
|
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, |
|
|
|
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, |
|
|
|
grpc_cq_completion* storage, bool internal) { |
|
|
|
grpc_cq_completion* storage, bool /*internal*/) { |
|
|
|
GPR_TIMER_SCOPE("cq_end_op_for_next", 0); |
|
|
|
GPR_TIMER_SCOPE("cq_end_op_for_next", 0); |
|
|
|
|
|
|
|
|
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) || |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) || |
|
|
@ -748,7 +751,7 @@ static void cq_end_op_for_next( |
|
|
|
static void cq_end_op_for_pluck( |
|
|
|
static void cq_end_op_for_pluck( |
|
|
|
grpc_completion_queue* cq, void* tag, grpc_error* error, |
|
|
|
grpc_completion_queue* cq, void* tag, grpc_error* error, |
|
|
|
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, |
|
|
|
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, |
|
|
|
grpc_cq_completion* storage, bool internal) { |
|
|
|
grpc_cq_completion* storage, bool /*internal*/) { |
|
|
|
GPR_TIMER_SCOPE("cq_end_op_for_pluck", 0); |
|
|
|
GPR_TIMER_SCOPE("cq_end_op_for_pluck", 0); |
|
|
|
|
|
|
|
|
|
|
|
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq); |
|
|
|
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq); |
|
|
@ -939,7 +942,7 @@ static void dump_pending_tags(grpc_completion_queue* cq) { |
|
|
|
gpr_free(out); |
|
|
|
gpr_free(out); |
|
|
|
} |
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
static void dump_pending_tags(grpc_completion_queue* cq) {} |
|
|
|
static void dump_pending_tags(grpc_completion_queue* /*cq*/) {} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline, |
|
|
|
static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline, |
|
|
|