diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-02-04 08:30:11 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-02-04 08:30:11 -0800 |
commit | 6a09ca80d62e291163409d27cc78c8371d3af32e (patch) | |
tree | d9e52116512c178f097694355004a932134faba3 /src/core | |
parent | d6731628bcedbe150d4f7cd09656bd506979b00f (diff) |
Eliminate condvar in chttp2 transport
This used to be necessary to guarantee safe deletion, but with refcounting changes in call it's no longer needed
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/transport/chttp2_transport.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index f560417617..0446e0ab9e 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -184,7 +184,6 @@ struct transport { gpr_uint8 is_client; gpr_mu mu; - gpr_cv cv; /* basic state management - what are we doing at the moment? */ gpr_uint8 reading; @@ -395,7 +394,6 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup, /* one ref is for destroy, the other for when ep becomes NULL */ gpr_ref_init(&t->refs, 2); gpr_mu_init(&t->mu); - gpr_cv_init(&t->cv); t->metadata_context = mdctx; t->str_grpc_timeout = grpc_mdstr_from_string(t->metadata_context, "grpc-timeout"); @@ -483,7 +481,6 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup, t->cb_user_data = sr.user_data; grpc_chttp2_hpack_parser_init(&t->hpack_parser, t->metadata_context); t->calling_back = 0; - gpr_cv_broadcast(&t->cv); unlock(t); unref_transport(t); } @@ -492,9 +489,6 @@ static void destroy_transport(grpc_transport *gt) { transport *t = (transport *)gt; gpr_mu_lock(&t->mu); - while (t->calling_back) { - gpr_cv_wait(&t->cv, &t->mu, gpr_inf_future); - } t->cb = NULL; gpr_mu_unlock(&t->mu); @@ -573,13 +567,6 @@ static void destroy_stream(grpc_transport *gt, grpc_stream *gs) { gpr_mu_lock(&t->mu); - /* await pending callbacks - TODO(ctiller): this could be optimized to check if this stream is getting - callbacks */ - while (t->calling_back) { - gpr_cv_wait(&t->cv, &t->mu, gpr_inf_future); - } - /* stop parsing if we're currently parsing this stream */ if (t->deframe_state == DTS_FRAME && t->incoming_stream_id == s->id && s->id != 0) { @@ -591,7 +578,6 @@ static void destroy_stream(grpc_transport *gt, grpc_stream *gs) { } remove_from_stream_map(t, s); - gpr_cv_broadcast(&t->cv); gpr_mu_unlock(&t->mu); grpc_sopb_destroy(&s->outgoing_sopb); @@ -761,7 +747,6 @@ static void unlock(transport *t) { if (perform_callbacks || call_closed || num_goaways) { lock(t); t->calling_back = 0; - gpr_cv_broadcast(&t->cv); unlock(t); unref_transport(t); } @@ -892,7 +877,6 @@ static void finish_write_common(transport *t, int success) { if (!t->reading) { grpc_endpoint_destroy(t->ep); t->ep = NULL; - gpr_cv_broadcast(&t->cv); unref_transport(t); /* safe because we'll still have the ref for write */ } unlock(t); @@ -1673,7 +1657,6 @@ static void recv_data(void *tp, gpr_slice *slices, size_t nslices, if (!t->writing && t->ep) { grpc_endpoint_destroy(t->ep); t->ep = NULL; - gpr_cv_broadcast(&t->cv); unref_transport(t); /* safe as we still have a ref for read */ } unlock(t); |