aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-08-04 13:07:24 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-08-04 13:07:24 -0700
commite43d05e32ae281aac598b049c68a11bd4bcaf33f (patch)
tree350da31a77553c4628ffe4a2f8042f41b0b3ea8d
parent427d7d71dc963e32d04120479b6e0ad53ae726a7 (diff)
Fix tsan bug
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
index fc71d2804a..c5e8f2f6d1 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
@@ -2143,9 +2143,12 @@ static void incoming_byte_stream_next_locked(grpc_exec_ctx *exec_ctx,
grpc_chttp2_stream_global *stream_global = &bs->stream->global;
if (bs->is_tail) {
+ gpr_mu_lock(&bs->slice_mu);
+ size_t cur_length = bs->slices.length;
+ gpr_mu_unlock(&bs->slice_mu);
incoming_byte_stream_update_flow_control(
exec_ctx, transport_global, stream_global,
- bs->next_action.max_size_hint, bs->slices.length);
+ bs->next_action.max_size_hint, cur_length);
}
gpr_mu_lock(&bs->slice_mu);
if (bs->slices.count > 0) {