aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-24 15:29:03 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-24 15:29:03 -0700
commitfc193e1ff40d1ae557caf84d644a1b3a9bfe95b3 (patch)
tree3de4cc5e5ecc48ba1b5d92aec6d4ba8b5c683668 /src
parent6301038bfc929eab09f8b744096166623e69f64f (diff)
Fix a livelock issue
Diffstat (limited to 'src')
-rw-r--r--src/core/surface/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index 80e6dc6d86..27fc0945f9 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -1046,12 +1046,13 @@ void grpc_server_shutdown_and_notify(grpc_server *server,
channel_broadcaster_init(server, &broadcaster);
+ gpr_atm_rel_store(&server->shutdown_flag, 1);
+
/* collect all unregistered then registered calls */
gpr_mu_lock(&server->mu_call);
kill_pending_work_locked(&exec_ctx, server);
gpr_mu_unlock(&server->mu_call);
- gpr_atm_rel_store(&server->shutdown_flag, 1);
maybe_finish_shutdown(&exec_ctx, server);
gpr_mu_unlock(&server->mu_global);