aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/channel/client_setup.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-05-13 12:48:36 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-05-13 12:48:36 -0700
commit6e51180b984c42f0b00516a6609d1d90e183b9b9 (patch)
tree16cf3f5eb3e0a3e98a0cc79b403d01374c0d3e82 /src/core/channel/client_setup.c
parent6f05140a2680130e32220f3bf47b61f9b4760b11 (diff)
Properly manage interest set for waiting calls
Diffstat (limited to 'src/core/channel/client_setup.c')
-rw-r--r--src/core/channel/client_setup.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/channel/client_setup.c b/src/core/channel/client_setup.c
index d3d31a9ffb..e2bd7ef52e 100644
--- a/src/core/channel/client_setup.c
+++ b/src/core/channel/client_setup.c
@@ -134,6 +134,20 @@ static void setup_add_interested_party(grpc_transport_setup *sp, grpc_pollset *p
gpr_mu_unlock(&s->mu);
}
+static void setup_del_interested_party(grpc_transport_setup *sp, grpc_pollset *pollset) {
+ grpc_client_setup *s = (grpc_client_setup *)sp;
+
+ gpr_mu_lock(&s->mu);
+ if (!s->active_request) {
+ gpr_mu_unlock(&s->mu);
+ return;
+ }
+
+ grpc_pollset_set_del_pollset(&s->active_request->interested_parties, pollset);
+
+ gpr_mu_unlock(&s->mu);
+}
+
/* cancel handshaking: cancel all requests, and shutdown (the caller promises
not to initiate again) */
static void setup_cancel(grpc_transport_setup *sp) {
@@ -184,6 +198,7 @@ void grpc_client_setup_cb_end(grpc_client_setup_request *r) {
/* vtable for transport setup */
static const grpc_transport_setup_vtable setup_vtable = {setup_initiate,
setup_add_interested_party,
+ setup_del_interested_party,
setup_cancel};
void grpc_client_setup_create_and_attach(