aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2015-06-18 11:40:47 -0700
committerGravatar Vijay Pai <vpai@google.com>2015-06-18 11:41:19 -0700
commitf75ed23c20c6bf3699a564b9e8e326b9966615c5 (patch)
treeeac2a24f84a86ab6a68a9500e00a153792a5f05f
parentd03adc340ae04df7ba6635192fdd3bfa9a3c607f (diff)
Fix scope of a lock
-rw-r--r--src/core/surface/server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index bb510b9ebf..546b17c1ff 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -656,11 +656,11 @@ static void destroy_call_elem(grpc_call_element *elem) {
removed[i] = call_list_remove(elem->call_data, i);
}
gpr_mu_unlock(&chand->server->mu_call);
- gpr_mu_lock(&chand->server->mu_global);
if (removed[ALL_CALLS]) {
+ gpr_mu_lock(&chand->server->mu_global);
decrement_call_count(chand);
+ gpr_mu_unlock(&chand->server->mu_global);
}
- gpr_mu_unlock(&chand->server->mu_global);
if (calld->host) {
grpc_mdstr_unref(calld->host);