diff options
author | Dan Zhang <danzh@google.com> | 2017-12-22 15:11:59 -0500 |
---|---|---|
committer | Dan Zhang <danzh@google.com> | 2017-12-22 15:11:59 -0500 |
commit | 0c2fc922a62eedf02e0e3ad070685b8265347ec7 (patch) | |
tree | 69d79753bb9d7dd77734a9aca0f7cca610815aed /test/core/iomgr | |
parent | 40ebe9af7f5f5a918b14286ffdebdf55c7f0c74b (diff) |
fix data race in shutdown_and_destroy_pollset
Diffstat (limited to 'test/core/iomgr')
-rw-r--r-- | test/core/iomgr/udp_server_test.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/core/iomgr/udp_server_test.cc b/test/core/iomgr/udp_server_test.cc index e676995753..dc1248bc1c 100644 --- a/test/core/iomgr/udp_server_test.cc +++ b/test/core/iomgr/udp_server_test.cc @@ -137,9 +137,11 @@ static void destroy_pollset(void* p, grpc_error* error) { } static void shutdown_and_destroy_pollset() { + gpr_mu_lock(g_mu); auto closure = GRPC_CLOSURE_CREATE(destroy_pollset, g_pollset, grpc_schedule_on_exec_ctx); grpc_pollset_shutdown(g_pollset, closure); + gpr_mu_unlock(g_mu); /* Flush exec_ctx to run |destroyed| */ grpc_core::ExecCtx::Get()->Flush(); } |