From 430f745e6b9118b02a34930ac850ce819889f3e5 Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Wed, 13 Dec 2017 16:44:35 -0800 Subject: [PATCH] Fix tsan in bad_client tests --- src/core/lib/iomgr/resource_quota.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc index cabe28e4e6d..eaf2f5d1b29 100644 --- a/src/core/lib/iomgr/resource_quota.cc +++ b/src/core/lib/iomgr/resource_quota.cc @@ -507,6 +507,7 @@ static void ru_shutdown(void* ru, grpc_error* error) { gpr_log(GPR_DEBUG, "RU shutdown %p", ru); } grpc_resource_user* resource_user = (grpc_resource_user*)ru; + gpr_mu_lock(&resource_user->mu); GRPC_CLOSURE_SCHED(resource_user->reclaimers[0], GRPC_ERROR_CANCELLED); GRPC_CLOSURE_SCHED(resource_user->reclaimers[1], GRPC_ERROR_CANCELLED); resource_user->reclaimers[0] = nullptr; @@ -516,6 +517,7 @@ static void ru_shutdown(void* ru, grpc_error* error) { if (resource_user->allocating) { rq_step_sched(resource_user->resource_quota); } + gpr_mu_unlock(&resource_user->mu); } static void ru_destroy(void* ru, grpc_error* error) {