diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-02-12 22:50:38 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-02-12 22:50:38 -0800 |
commit | 5d6bd443818f157995207c3049820dead5fdcde0 (patch) | |
tree | 1f8bc95a7b50eb71e5150fb2a2624b40357c5040 /src/core | |
parent | db73e90e3bd956c4be471789d8e23f5eb2a4601e (diff) |
Fix tsan reported race
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/surface/server.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 169fb1a781..4ae6f5d955 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -708,6 +708,7 @@ grpc_transport_setup_result grpc_server_setup_transport( gpr_uint32 slots; gpr_uint32 probes; gpr_uint32 max_probes = 0; + grpc_transport_setup_result result; for (i = 0; i < s->channel_filter_count; i++) { filters[i] = s->channel_filters[i]; @@ -758,6 +759,9 @@ grpc_transport_setup_result grpc_server_setup_transport( chand->registered_method_max_probes = max_probes; } + result = grpc_connected_channel_bind_transport( + grpc_channel_get_channel_stack(channel), transport); + gpr_mu_lock(&s->mu); chand->next = &s->root_channel_data; chand->prev = chand->next->prev; @@ -766,8 +770,7 @@ grpc_transport_setup_result grpc_server_setup_transport( gpr_free(filters); - return grpc_connected_channel_bind_transport( - grpc_channel_get_channel_stack(channel), transport); + return result; } static void shutdown_internal(grpc_server *server, gpr_uint8 have_shutdown_tag, |