aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-13 15:37:58 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-14 01:36:28 -0800
commit75122c23578e24417dcf64081c737571a9fc2dbc (patch)
treef4b8491964ec0508a5826490628c9f87b82c3326 /src/core/lib/surface
parent36cd68f0d543b9024c84eff82319890a791de7f6 (diff)
Address some PR comments
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r--src/core/lib/surface/alarm.cc4
-rw-r--r--src/core/lib/surface/byte_buffer.cc1
-rw-r--r--src/core/lib/surface/byte_buffer_reader.cc4
-rw-r--r--src/core/lib/surface/call.cc7
-rw-r--r--src/core/lib/surface/call_details.cc1
-rw-r--r--src/core/lib/surface/channel.cc9
-rw-r--r--src/core/lib/surface/channel_ping.cc1
-rw-r--r--src/core/lib/surface/completion_queue.cc138
-rw-r--r--src/core/lib/surface/init.cc5
-rw-r--r--src/core/lib/surface/lame_client.cc2
-rw-r--r--src/core/lib/surface/server.cc15
11 files changed, 93 insertions, 94 deletions
diff --git a/src/core/lib/surface/alarm.cc b/src/core/lib/surface/alarm.cc
index 395ffd393c..7aee100f3f 100644
--- a/src/core/lib/surface/alarm.cc
+++ b/src/core/lib/surface/alarm.cc
@@ -51,7 +51,7 @@ static void alarm_unref(grpc_alarm* alarm) {
if (alarm->cq != NULL) {
GRPC_CQ_INTERNAL_UNREF(alarm->cq, "alarm");
}
- grpc_exec_ctx_finish();
+
gpr_free(alarm);
}
}
@@ -126,13 +126,11 @@ void grpc_alarm_set(grpc_alarm* alarm, grpc_completion_queue* cq,
GPR_ASSERT(grpc_cq_begin_op(cq, tag));
grpc_timer_init(&alarm->alarm, grpc_timespec_to_millis_round_up(deadline),
&alarm->on_alarm);
- grpc_exec_ctx_finish();
}
void grpc_alarm_cancel(grpc_alarm* alarm, void* reserved) {
ExecCtx _local_exec_ctx;
grpc_timer_cancel(&alarm->alarm);
- grpc_exec_ctx_finish();
}
void grpc_alarm_destroy(grpc_alarm* alarm, void* reserved) {
diff --git a/src/core/lib/surface/byte_buffer.cc b/src/core/lib/surface/byte_buffer.cc
index f3c10797f3..6a9b13bb41 100644
--- a/src/core/lib/surface/byte_buffer.cc
+++ b/src/core/lib/surface/byte_buffer.cc
@@ -78,7 +78,6 @@ void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) {
break;
}
gpr_free(bb);
- grpc_exec_ctx_finish();
}
size_t grpc_byte_buffer_length(grpc_byte_buffer* bb) {
diff --git a/src/core/lib/surface/byte_buffer_reader.cc b/src/core/lib/surface/byte_buffer_reader.cc
index fb66829baa..9a9e26ecdc 100644
--- a/src/core/lib/surface/byte_buffer_reader.cc
+++ b/src/core/lib/surface/byte_buffer_reader.cc
@@ -70,7 +70,7 @@ int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
reader->current.index = 0;
break;
}
- grpc_exec_ctx_finish();
+
return 1;
}
@@ -118,6 +118,6 @@ grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader* reader) {
grpc_slice_unref_internal(in_slice);
GPR_ASSERT(bytes_read <= input_size);
}
- grpc_exec_ctx_finish();
+
return out_slice;
}
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index 5e1c0badd0..bbb7a39e29 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -595,7 +595,7 @@ void grpc_call_unref(grpc_call* c) {
grpc_call_combiner_set_notify_on_cancel(&c->call_combiner, NULL);
}
GRPC_CALL_INTERNAL_UNREF(c, "destroy");
- grpc_exec_ctx_finish();
+
GPR_TIMER_END("grpc_call_unref", 0);
}
@@ -604,7 +604,7 @@ grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
GPR_ASSERT(!reserved);
ExecCtx _local_exec_ctx;
cancel_with_error(call, STATUS_FROM_API_OVERRIDE, GRPC_ERROR_CANCELLED);
- grpc_exec_ctx_finish();
+
return GRPC_CALL_OK;
}
@@ -659,7 +659,7 @@ grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
4, (c, (int)status, description, reserved));
GPR_ASSERT(reserved == NULL);
cancel_with_status(c, STATUS_FROM_API_OVERRIDE, status, description);
- grpc_exec_ctx_finish();
+
return GRPC_CALL_OK;
}
@@ -2048,7 +2048,6 @@ grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
err = call_start_batch(call, ops, nops, tag, 0);
}
- grpc_exec_ctx_finish();
return err;
}
diff --git a/src/core/lib/surface/call_details.cc b/src/core/lib/surface/call_details.cc
index 01b19abefb..03ce7f88fb 100644
--- a/src/core/lib/surface/call_details.cc
+++ b/src/core/lib/surface/call_details.cc
@@ -37,5 +37,4 @@ void grpc_call_details_destroy(grpc_call_details* cd) {
ExecCtx _local_exec_ctx;
grpc_slice_unref_internal(cd->method);
grpc_slice_unref_internal(cd->host);
- grpc_exec_ctx_finish();
}
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc
index dc1fc1632e..7725351f74 100644
--- a/src/core/lib/surface/channel.cc
+++ b/src/core/lib/surface/channel.cc
@@ -252,7 +252,6 @@ void grpc_channel_get_info(grpc_channel* channel,
grpc_channel_element* elem =
grpc_channel_stack_element(CHANNEL_STACK_FROM_CHANNEL(channel), 0);
elem->filter->get_channel_info(elem, channel_info);
- grpc_exec_ctx_finish();
}
static grpc_call* grpc_channel_create_call_internal(
@@ -305,7 +304,7 @@ grpc_call* grpc_channel_create_call(grpc_channel* channel,
grpc_slice_ref_internal(*host))
: GRPC_MDNULL,
grpc_timespec_to_millis_round_up(deadline));
- grpc_exec_ctx_finish();
+
return call;
}
@@ -344,7 +343,7 @@ void* grpc_channel_register_call(grpc_channel* channel, const char* method,
rc->next = channel->registered_calls;
channel->registered_calls = rc;
gpr_mu_unlock(&channel->registered_call_mu);
- grpc_exec_ctx_finish();
+
return rc;
}
@@ -370,7 +369,7 @@ grpc_call* grpc_channel_create_registered_call(
channel, parent_call, propagation_mask, completion_queue, NULL,
GRPC_MDELEM_REF(rc->path), GRPC_MDELEM_REF(rc->authority),
grpc_timespec_to_millis_round_up(deadline));
- grpc_exec_ctx_finish();
+
return call;
}
@@ -416,8 +415,6 @@ void grpc_channel_destroy(grpc_channel* channel) {
elem->filter->start_transport_op(elem, op);
GRPC_CHANNEL_INTERNAL_UNREF(channel, "channel");
-
- grpc_exec_ctx_finish();
}
grpc_channel_stack* grpc_channel_get_channel_stack(grpc_channel* channel) {
diff --git a/src/core/lib/surface/channel_ping.cc b/src/core/lib/surface/channel_ping.cc
index 0966a8d967..06cdbf6c73 100644
--- a/src/core/lib/surface/channel_ping.cc
+++ b/src/core/lib/surface/channel_ping.cc
@@ -60,5 +60,4 @@ void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq,
op->bind_pollset = grpc_cq_pollset(cq);
GPR_ASSERT(grpc_cq_begin_op(cq, tag));
top_elem->filter->start_transport_op(top_elem, op);
- grpc_exec_ctx_finish();
}
diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc
index b69d40534d..0b0a8d070d 100644
--- a/src/core/lib/surface/completion_queue.cc
+++ b/src/core/lib/surface/completion_queue.cc
@@ -124,7 +124,7 @@ static grpc_error* non_polling_poller_work(grpc_pollset* pollset,
while (!npp->shutdown && !w.kicked &&
!gpr_cv_wait(&w.cv, &npp->mu, deadline_ts))
;
- grpc_exec_ctx_invalidate_now();
+ ExecCtx::Get()->InvalidateNow();
if (&w == npp->root) {
npp->root = w.next;
if (&w == npp->root) {
@@ -371,7 +371,6 @@ int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
gpr_mu_unlock(cq->mu);
GRPC_CQ_INTERNAL_UNREF(cq, "shutting_down");
}
- grpc_exec_ctx_finish();
}
gpr_tls_set(&g_cached_event, (intptr_t)0);
gpr_tls_set(&g_cached_cq, (intptr_t)0);
@@ -412,8 +411,6 @@ static grpc_cq_completion* cq_event_queue_pop(grpc_cq_event_queue* q) {
GRPC_STATS_INC_CQ_EV_QUEUE_TRYLOCK_FAILURES();
}
- grpc_exec_ctx_finish();
-
if (c) {
gpr_atm_no_barrier_fetch_add(&q->num_queue_items, -1);
}
@@ -445,7 +442,6 @@ grpc_completion_queue* grpc_completion_queue_create_internal(
ExecCtx _local_exec_ctx;
GRPC_STATS_INC_CQS_CREATED();
- grpc_exec_ctx_finish();
cq = (grpc_completion_queue*)gpr_zalloc(sizeof(grpc_completion_queue) +
vtable->data_size +
@@ -639,9 +635,9 @@ static void cq_end_op_for_next(grpc_completion_queue* cq, void* tag,
error != GRPC_ERROR_NONE)) {
const char* errmsg = grpc_error_string(error);
GRPC_API_TRACE(
- "cq_end_op_for_next(=%p, cq=%p, tag=%p, error=%s, "
+ "cq_end_op_for_next(cq=%p, tag=%p, error=%s, "
"done=%p, done_arg=%p, storage=%p)",
- 7, (exec_ctx, cq, tag, errmsg, done, done_arg, storage));
+ 6, (cq, tag, errmsg, done, done_arg, storage));
if (GRPC_TRACER_ON(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
@@ -726,9 +722,9 @@ static void cq_end_op_for_pluck(grpc_completion_queue* cq, void* tag,
error != GRPC_ERROR_NONE)) {
const char* errmsg = grpc_error_string(error);
GRPC_API_TRACE(
- "cq_end_op_for_pluck(=%p, cq=%p, tag=%p, error=%s, "
+ "cq_end_op_for_pluck(cq=%p, tag=%p, error=%s, "
"done=%p, done_arg=%p, storage=%p)",
- 7, (exec_ctx, cq, tag, errmsg, done, done_arg, storage));
+ 6, (cq, tag, errmsg, done, done_arg, storage));
if (GRPC_TRACER_ON(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
@@ -794,31 +790,40 @@ typedef struct {
bool first_loop;
} cq_is_finished_arg;
-static bool cq_is_next_finished(void* arg) {
- cq_is_finished_arg* a = (cq_is_finished_arg*)arg;
- grpc_completion_queue* cq = a->cq;
- cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
- GPR_ASSERT(a->stolen_completion == NULL);
+class ExecCtxNext : public ExecCtx {
+ public:
+ ExecCtxNext(void* arg) : ExecCtx(0), check_ready_to_finish_arg_(arg) {}
- gpr_atm current_last_seen_things_queued_ever =
- gpr_atm_no_barrier_load(&cqd->things_queued_ever);
+ bool CheckReadyToFinish() override {
+ cq_is_finished_arg* a = (cq_is_finished_arg*)check_ready_to_finish_arg_;
+ grpc_completion_queue* cq = a->cq;
+ cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
+ GPR_ASSERT(a->stolen_completion == NULL);
- if (current_last_seen_things_queued_ever != a->last_seen_things_queued_ever) {
- a->last_seen_things_queued_ever =
+ gpr_atm current_last_seen_things_queued_ever =
gpr_atm_no_barrier_load(&cqd->things_queued_ever);
- /* Pop a cq_completion from the queue. Returns NULL if the queue is empty
- * might return NULL in some cases even if the queue is not empty; but
- * that
- * is ok and doesn't affect correctness. Might effect the tail latencies a
- * bit) */
- a->stolen_completion = cq_event_queue_pop(&cqd->queue);
- if (a->stolen_completion != NULL) {
- return true;
+ if (current_last_seen_things_queued_ever !=
+ a->last_seen_things_queued_ever) {
+ a->last_seen_things_queued_ever =
+ gpr_atm_no_barrier_load(&cqd->things_queued_ever);
+
+ /* Pop a cq_completion from the queue. Returns NULL if the queue is empty
+ * might return NULL in some cases even if the queue is not empty; but
+ * that
+ * is ok and doesn't affect correctness. Might effect the tail latencies a
+ * bit) */
+ a->stolen_completion = cq_event_queue_pop(&cqd->queue);
+ if (a->stolen_completion != NULL) {
+ return true;
+ }
}
+ return !a->first_loop && a->deadline < ExecCtx::Get()->Now();
}
- return !a->first_loop && a->deadline < grpc_exec_ctx_now();
-}
+
+ private:
+ void* check_ready_to_finish_arg_;
+};
#ifndef NDEBUG
static void dump_pending_tags(grpc_completion_queue* cq) {
@@ -873,7 +878,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
NULL,
NULL,
true};
- ExecCtx _local_exec_ctx(0, cq_is_next_finished, &is_finished_arg);
+ ExecCtxNext _local_exec_ctx(&is_finished_arg);
for (;;) {
grpc_millis iteration_deadline = deadline_millis;
@@ -923,7 +928,8 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
break;
}
- if (!is_finished_arg.first_loop && grpc_exec_ctx_now() >= deadline_millis) {
+ if (!is_finished_arg.first_loop &&
+ ExecCtx::Get()->Now() >= deadline_millis) {
memset(&ret, 0, sizeof(ret));
ret.type = GRPC_QUEUE_TIMEOUT;
dump_pending_tags(cq);
@@ -959,7 +965,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, &ret);
GRPC_CQ_INTERNAL_UNREF(cq, "next");
- grpc_exec_ctx_finish();
+
GPR_ASSERT(is_finished_arg.stolen_completion == NULL);
GPR_TIMER_END("grpc_completion_queue_next", 0);
@@ -1039,37 +1045,46 @@ static void del_plucker(grpc_completion_queue* cq, void* tag,
GPR_UNREACHABLE_CODE(return );
}
-static bool cq_is_pluck_finished(void* arg) {
- cq_is_finished_arg* a = (cq_is_finished_arg*)arg;
- grpc_completion_queue* cq = a->cq;
- cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
+class ExecCtxPluck : public ExecCtx {
+ public:
+ ExecCtxPluck(void* arg) : ExecCtx(0), check_ready_to_finish_arg_(arg) {}
- GPR_ASSERT(a->stolen_completion == NULL);
- gpr_atm current_last_seen_things_queued_ever =
- gpr_atm_no_barrier_load(&cqd->things_queued_ever);
- if (current_last_seen_things_queued_ever != a->last_seen_things_queued_ever) {
- gpr_mu_lock(cq->mu);
- a->last_seen_things_queued_ever =
+ bool CheckReadyToFinish() override {
+ cq_is_finished_arg* a = (cq_is_finished_arg*)check_ready_to_finish_arg_;
+ grpc_completion_queue* cq = a->cq;
+ cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
+
+ GPR_ASSERT(a->stolen_completion == NULL);
+ gpr_atm current_last_seen_things_queued_ever =
gpr_atm_no_barrier_load(&cqd->things_queued_ever);
- grpc_cq_completion* c;
- grpc_cq_completion* prev = &cqd->completed_head;
- while ((c = (grpc_cq_completion*)(prev->next & ~(uintptr_t)1)) !=
- &cqd->completed_head) {
- if (c->tag == a->tag) {
- prev->next = (prev->next & (uintptr_t)1) | (c->next & ~(uintptr_t)1);
- if (c == cqd->completed_tail) {
- cqd->completed_tail = prev;
+ if (current_last_seen_things_queued_ever !=
+ a->last_seen_things_queued_ever) {
+ gpr_mu_lock(cq->mu);
+ a->last_seen_things_queued_ever =
+ gpr_atm_no_barrier_load(&cqd->things_queued_ever);
+ grpc_cq_completion* c;
+ grpc_cq_completion* prev = &cqd->completed_head;
+ while ((c = (grpc_cq_completion*)(prev->next & ~(uintptr_t)1)) !=
+ &cqd->completed_head) {
+ if (c->tag == a->tag) {
+ prev->next = (prev->next & (uintptr_t)1) | (c->next & ~(uintptr_t)1);
+ if (c == cqd->completed_tail) {
+ cqd->completed_tail = prev;
+ }
+ gpr_mu_unlock(cq->mu);
+ a->stolen_completion = c;
+ return true;
}
- gpr_mu_unlock(cq->mu);
- a->stolen_completion = c;
- return true;
+ prev = c;
}
- prev = c;
+ gpr_mu_unlock(cq->mu);
}
- gpr_mu_unlock(cq->mu);
+ return !a->first_loop && a->deadline < ExecCtx::Get()->Now();
}
- return !a->first_loop && a->deadline < grpc_exec_ctx_now();
-}
+
+ private:
+ void* check_ready_to_finish_arg_;
+};
static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
gpr_timespec deadline, void* reserved) {
@@ -1106,7 +1121,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
NULL,
tag,
true};
- ExecCtx _local_exec_ctx(0, cq_is_pluck_finished, &is_finished_arg);
+ ExecCtxPluck _local_exec_ctx(&is_finished_arg);
for (;;) {
if (is_finished_arg.stolen_completion != NULL) {
gpr_mu_unlock(cq->mu);
@@ -1153,7 +1168,8 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
dump_pending_tags(cq);
break;
}
- if (!is_finished_arg.first_loop && grpc_exec_ctx_now() >= deadline_millis) {
+ if (!is_finished_arg.first_loop &&
+ ExecCtx::Get()->Now() >= deadline_millis) {
del_plucker(cq, tag, &worker);
gpr_mu_unlock(cq->mu);
memset(&ret, 0, sizeof(ret));
@@ -1182,7 +1198,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
done:
GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, &ret);
GRPC_CQ_INTERNAL_UNREF(cq, "pluck");
- grpc_exec_ctx_finish();
+
GPR_ASSERT(is_finished_arg.stolen_completion == NULL);
GPR_TIMER_END("grpc_completion_queue_pluck", 0);
@@ -1238,7 +1254,7 @@ void grpc_completion_queue_shutdown(grpc_completion_queue* cq) {
GPR_TIMER_BEGIN("grpc_completion_queue_shutdown", 0);
GRPC_API_TRACE("grpc_completion_queue_shutdown(cq=%p)", 1, (cq));
cq->vtable->shutdown(cq);
- grpc_exec_ctx_finish();
+
GPR_TIMER_END("grpc_completion_queue_shutdown", 0);
}
@@ -1249,7 +1265,7 @@ void grpc_completion_queue_destroy(grpc_completion_queue* cq) {
ExecCtx _local_exec_ctx;
GRPC_CQ_INTERNAL_UNREF(cq, "destroy");
- grpc_exec_ctx_finish();
+
GPR_TIMER_END("grpc_completion_queue_destroy", 0);
}
diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc
index 66c8c3b6da..20e17a7f60 100644
--- a/src/core/lib/surface/init.cc
+++ b/src/core/lib/surface/init.cc
@@ -168,14 +168,14 @@ void grpc_init(void) {
grpc_iomgr_start();
}
gpr_mu_unlock(&g_init_mu);
- grpc_exec_ctx_finish();
+
GRPC_API_TRACE("grpc_init(void)", 0, ());
}
void grpc_shutdown(void) {
int i;
GRPC_API_TRACE("grpc_shutdown(void)", 0, ());
- ExecCtx _local_exec_ctx(0, grpc_never_ready_to_finish, NULL);
+ ExecCtx _local_exec_ctx;
gpr_mu_lock(&g_init_mu);
if (--g_initializations == 0) {
grpc_executor_shutdown();
@@ -194,7 +194,6 @@ void grpc_shutdown(void) {
grpc_stats_shutdown();
}
gpr_mu_unlock(&g_init_mu);
- grpc_exec_ctx_finish();
}
int grpc_is_initialized(void) {
diff --git a/src/core/lib/surface/lame_client.cc b/src/core/lib/surface/lame_client.cc
index 5cd8c1fd89..da081e68cb 100644
--- a/src/core/lib/surface/lame_client.cc
+++ b/src/core/lib/surface/lame_client.cc
@@ -169,6 +169,6 @@ grpc_channel* grpc_lame_client_channel_create(const char* target,
auto chand = reinterpret_cast<grpc_core::ChannelData*>(elem->channel_data);
chand->error_code = error_code;
chand->error_message = error_message;
- grpc_exec_ctx_finish();
+
return channel;
}
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc
index 6e3ce005a2..0d4435d556 100644
--- a/src/core/lib/surface/server.cc
+++ b/src/core/lib/surface/server.cc
@@ -1047,8 +1047,6 @@ void grpc_server_start(grpc_server* server) {
GRPC_CLOSURE_CREATE(start_listeners, server,
grpc_executor_scheduler(GRPC_EXECUTOR_SHORT)),
GRPC_ERROR_NONE);
-
- grpc_exec_ctx_finish();
}
void grpc_server_get_pollsets(grpc_server* server, grpc_pollset*** pollsets,
@@ -1188,7 +1186,7 @@ void grpc_server_shutdown_and_notify(grpc_server* server,
grpc_cq_end_op(cq, tag, GRPC_ERROR_NONE, done_published_shutdown, NULL,
(grpc_cq_completion*)gpr_malloc(sizeof(grpc_cq_completion)));
gpr_mu_unlock(&server->mu_global);
- goto done;
+ return;
}
server->shutdown_tags = (shutdown_tag*)gpr_realloc(
server->shutdown_tags,
@@ -1198,7 +1196,7 @@ void grpc_server_shutdown_and_notify(grpc_server* server,
sdt->cq = cq;
if (gpr_atm_acq_load(&server->shutdown_flag)) {
gpr_mu_unlock(&server->mu_global);
- goto done;
+ return;
}
server->last_shutdown_message_time = gpr_now(GPR_CLOCK_REALTIME);
@@ -1225,9 +1223,6 @@ void grpc_server_shutdown_and_notify(grpc_server* server,
channel_broadcaster_shutdown(&broadcaster, true /* send_goaway */,
GRPC_ERROR_NONE);
-
-done:
- grpc_exec_ctx_finish();
}
void grpc_server_cancel_all_calls(grpc_server* server) {
@@ -1243,7 +1238,6 @@ void grpc_server_cancel_all_calls(grpc_server* server) {
channel_broadcaster_shutdown(
&broadcaster, false /* send_goaway */,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Cancelling all calls"));
- grpc_exec_ctx_finish();
}
void grpc_server_destroy(grpc_server* server) {
@@ -1265,7 +1259,6 @@ void grpc_server_destroy(grpc_server* server) {
gpr_mu_unlock(&server->mu_global);
server_unref(server);
- grpc_exec_ctx_finish();
}
void grpc_server_add_listener(grpc_server* server, void* arg,
@@ -1368,7 +1361,7 @@ grpc_call_error grpc_server_request_call(
rc->initial_metadata = initial_metadata;
error = queue_call_request(server, cq_idx, rc);
done:
- grpc_exec_ctx_finish();
+
return error;
}
@@ -1425,7 +1418,7 @@ grpc_call_error grpc_server_request_registered_call(
rc->data.registered.optional_payload = optional_payload;
error = queue_call_request(server, cq_idx, rc);
done:
- grpc_exec_ctx_finish();
+
return error;
}