aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/subchannel_index.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ext/filters/client_channel/subchannel_index.cc')
-rw-r--r--src/core/ext/filters/client_channel/subchannel_index.cc28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/core/ext/filters/client_channel/subchannel_index.cc b/src/core/ext/filters/client_channel/subchannel_index.cc
index 0c4213cf77..cb8e480734 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.cc
+++ b/src/core/ext/filters/client_channel/subchannel_index.cc
@@ -81,16 +81,14 @@ int grpc_subchannel_key_compare(const grpc_subchannel_key* a,
return grpc_channel_args_compare(a->args.args, b->args.args);
}
-void grpc_subchannel_key_destroy(grpc_exec_ctx* exec_ctx,
- grpc_subchannel_key* k) {
+void grpc_subchannel_key_destroy(grpc_subchannel_key* k) {
gpr_free((grpc_channel_args*)k->args.filters);
- grpc_channel_args_destroy(exec_ctx, (grpc_channel_args*)k->args.args);
+ grpc_channel_args_destroy((grpc_channel_args*)k->args.args);
gpr_free(k);
}
static void sck_avl_destroy(void* p, void* user_data) {
- grpc_exec_ctx* exec_ctx = (grpc_exec_ctx*)user_data;
- grpc_subchannel_key_destroy(exec_ctx, (grpc_subchannel_key*)p);
+ grpc_subchannel_key_destroy((grpc_subchannel_key*)p);
}
static void* sck_avl_copy(void* p, void* unused) {
@@ -103,8 +101,7 @@ static long sck_avl_compare(void* a, void* b, void* unused) {
}
static void scv_avl_destroy(void* p, void* user_data) {
- grpc_exec_ctx* exec_ctx = (grpc_exec_ctx*)user_data;
- GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, (grpc_subchannel*)p, "subchannel_index");
+ GRPC_SUBCHANNEL_WEAK_UNREF((grpc_subchannel*)p, "subchannel_index");
}
static void* scv_avl_copy(void* p, void* unused) {
@@ -135,17 +132,16 @@ void grpc_subchannel_index_shutdown(void) {
void grpc_subchannel_index_unref(void) {
if (gpr_unref(&g_refcount)) {
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ ExecCtx _local_exec_ctx;
gpr_mu_destroy(&g_mu);
- gpr_avl_unref(g_subchannel_index, &exec_ctx);
- grpc_exec_ctx_finish(&exec_ctx);
+ gpr_avl_unref(g_subchannel_index, exec_ctx);
+ grpc_exec_ctx_finish();
}
}
void grpc_subchannel_index_ref(void) { gpr_ref_non_zero(&g_refcount); }
-grpc_subchannel* grpc_subchannel_index_find(grpc_exec_ctx* exec_ctx,
- grpc_subchannel_key* key) {
+grpc_subchannel* grpc_subchannel_index_find(grpc_subchannel_key* key) {
// Lock, and take a reference to the subchannel index.
// We don't need to do the search under a lock as avl's are immutable.
gpr_mu_lock(&g_mu);
@@ -159,8 +155,7 @@ grpc_subchannel* grpc_subchannel_index_find(grpc_exec_ctx* exec_ctx,
return c;
}
-grpc_subchannel* grpc_subchannel_index_register(grpc_exec_ctx* exec_ctx,
- grpc_subchannel_key* key,
+grpc_subchannel* grpc_subchannel_index_register(grpc_subchannel_key* key,
grpc_subchannel* constructed) {
grpc_subchannel* c = NULL;
bool need_to_unref_constructed;
@@ -204,14 +199,13 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_exec_ctx* exec_ctx,
}
if (need_to_unref_constructed) {
- GRPC_SUBCHANNEL_UNREF(exec_ctx, constructed, "index_register");
+ GRPC_SUBCHANNEL_UNREF(constructed, "index_register");
}
return c;
}
-void grpc_subchannel_index_unregister(grpc_exec_ctx* exec_ctx,
- grpc_subchannel_key* key,
+void grpc_subchannel_index_unregister(grpc_subchannel_key* key,
grpc_subchannel* constructed) {
bool done = false;
while (!done) {