diff options
author | Craig Tiller <ctiller@google.com> | 2016-12-28 15:44:25 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-12-28 15:44:25 -0800 |
commit | 91031dacb1ff5c57500307044b18c9f929134462 (patch) | |
tree | 129cd181da27264258804a2d99a9345ac7fde305 /src/core/ext/resolver/dns | |
parent | ddebfa65f2bdff332902adf73606bc050014b498 (diff) |
Changes to exec_ctx/closure/combiner/workqueue interfaces
- make closures know where they should be executed (eg, on a workqueue,
or a combiner, or on an exec_ctx)
- this allows removal of a large number of trampoline functions that
were appearing whenever we used combiners, and should allow for a much
easier interface to combiner locks
Diffstat (limited to 'src/core/ext/resolver/dns')
-rw-r--r-- | src/core/ext/resolver/dns/native/dns_resolver.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 2675fa931f..efbb2be4e1 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -112,8 +112,8 @@ static void dns_shutdown(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver) { } if (r->next_completion != NULL) { *r->target_result = NULL; - grpc_exec_ctx_sched(exec_ctx, r->next_completion, - GRPC_ERROR_CREATE("Resolver Shutdown"), NULL); + grpc_closure_sched(exec_ctx, r->next_completion, + GRPC_ERROR_CREATE("Resolver Shutdown")); r->next_completion = NULL; } gpr_mu_unlock(&r->mu); @@ -219,9 +219,10 @@ static void dns_start_resolving_locked(grpc_exec_ctx *exec_ctx, GPR_ASSERT(!r->resolving); r->resolving = true; r->addresses = NULL; - grpc_resolve_address(exec_ctx, r->name_to_resolve, r->default_port, - r->interested_parties, - grpc_closure_create(dns_on_resolved, r), &r->addresses); + grpc_resolve_address( + exec_ctx, r->name_to_resolve, r->default_port, r->interested_parties, + grpc_closure_create(dns_on_resolved, r, grpc_schedule_on_exec_ctx), + &r->addresses); } static void dns_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx, @@ -231,7 +232,7 @@ static void dns_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx, *r->target_result = r->resolved_result == NULL ? NULL : grpc_channel_args_copy(r->resolved_result); - grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL); + grpc_closure_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE); r->next_completion = NULL; r->published_version = r->resolved_version; } |