aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2017-05-17 17:23:47 -0700
committerGravatar yang-g <yangg@google.com>2017-05-17 17:23:47 -0700
commit67cda0a701ff5698c54336df464d12ff9bd12b08 (patch)
tree0cb893cb697c0df7dfcf7cfa15dca7d812e6328a /src/core
parentbcb65f0bd533ff0c7babf3b06a424d2bd5f1d37d (diff)
Unref pending events under cq lock
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/surface/completion_queue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c
index b0a4b1fbcc..de905941c1 100644
--- a/src/core/lib/surface/completion_queue.c
+++ b/src/core/lib/surface/completion_queue.c
@@ -582,9 +582,9 @@ static void cq_end_op_for_next(grpc_exec_ctx *exec_ctx,
cq_event_queue_push(&cqd->queue, storage);
gpr_atm_no_barrier_fetch_add(&cqd->things_queued_ever, 1);
- int shutdown = gpr_unref(&cqd->pending_events);
-
gpr_mu_lock(cqd->mu);
+
+ int shutdown = gpr_unref(&cqd->pending_events);
if (!shutdown) {
grpc_error *kick_error = cc->poller_vtable->kick(POLLSET_FROM_CQ(cc), NULL);
gpr_mu_unlock(cqd->mu);