diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2016-01-07 07:14:44 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2016-01-07 07:14:44 -0800 |
commit | 093193edb785aee0ae90a604b4fae876b8a626b0 (patch) | |
tree | c1ec5b2e58163d77ed2f42bcf57cbebd39ba36e7 /src/core/client_config | |
parent | d27c78db0936d44599acbcd701f7a3159dec3fcd (diff) |
Fix pings
Diffstat (limited to 'src/core/client_config')
-rw-r--r-- | src/core/client_config/lb_policies/pick_first.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/client_config/lb_policies/pick_first.c b/src/core/client_config/lb_policies/pick_first.c index 9beaeba2b4..4a90b07002 100644 --- a/src/core/client_config/lb_policies/pick_first.c +++ b/src/core/client_config/lb_policies/pick_first.c @@ -368,13 +368,12 @@ void pf_notify_on_state_change(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, void pf_ping_one(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_closure *closure) { pick_first_lb_policy *p = (pick_first_lb_policy *)pol; - gpr_mu_lock(&p->mu); - if (p->selected) { - grpc_connected_subchannel_ping(exec_ctx, p->selected, closure); + grpc_connected_subchannel *selected = GET_SELECTED(p); + if (selected) { + grpc_connected_subchannel_ping(exec_ctx, selected, closure); } else { grpc_exec_ctx_enqueue(exec_ctx, closure, 0); } - gpr_mu_unlock(&p->mu); } static const grpc_lb_policy_vtable pick_first_lb_policy_vtable = { |