diff options
author | Craig Tiller <ctiller@google.com> | 2015-02-11 16:12:41 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-02-11 16:12:41 -0800 |
commit | dcf9c0e588fce023b0644010c837681b4f303c20 (patch) | |
tree | d4c1ecc9c5f9121129e94b1deb80c9f2d375d0f6 /src | |
parent | 9dcb0f8e1d58d3f6f4d14b47bddb53ba8cf83a42 (diff) |
Fix race
Diffstat (limited to 'src')
-rw-r--r-- | src/core/transport/chttp2_transport.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index ea579cf4a5..7d78bfa0cc 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -478,9 +478,6 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup, ref_transport(t); gpr_mu_unlock(&t->mu); - ref_transport(t); - recv_data(t, slices, nslices, GRPC_ENDPOINT_CB_OK); - sr = setup(arg, &t->base, t->metadata_context); lock(t); @@ -488,6 +485,10 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup, t->cb_user_data = sr.user_data; t->calling_back = 0; unlock(t); + + ref_transport(t); + recv_data(t, slices, nslices, GRPC_ENDPOINT_CB_OK); + unref_transport(t); } |