From da11694971f12ee973e84c9386494a161228e51a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 3 Jun 2015 08:05:51 -0700 Subject: [PATCH] Fix TSAN reported errors --- src/core/security/server_secure_chttp2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c index 10266c80885..b312bdd0b61 100644 --- a/src/core/security/server_secure_chttp2.c +++ b/src/core/security/server_secure_chttp2.c @@ -66,6 +66,10 @@ static void state_ref(grpc_server_secure_state *state) { static void state_unref(grpc_server_secure_state *state) { if (gpr_unref(&state->refcount)) { + /* ensure all threads have unlocked */ + gpr_mu_lock(&state->mu); + gpr_mu_unlock(&state->mu); + /* clean up */ grpc_security_connector_unref(state->sc); gpr_free(state); }