aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/backup_poller.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-12-07 19:38:43 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-12-07 19:38:43 -0800
commitd6c292f17779771e665816f8f3a4cf366fc7012e (patch)
treeae779349708ad4896f8a3b5c074e45e581172cba /src/core/ext/filters/client_channel/backup_poller.cc
parent8cf1470a51ea276ca84825e7495d4ee24743540d (diff)
parentc01a91da2d43e858cace8b34119fa35148818458 (diff)
Merge master
Diffstat (limited to 'src/core/ext/filters/client_channel/backup_poller.cc')
-rw-r--r--src/core/ext/filters/client_channel/backup_poller.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/ext/filters/client_channel/backup_poller.cc b/src/core/ext/filters/client_channel/backup_poller.cc
index 339a79b0fb..bfc549e709 100644
--- a/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/src/core/ext/filters/client_channel/backup_poller.cc
@@ -82,8 +82,8 @@ static void done_poller(void* arg, grpc_error* error) {
}
static void g_poller_unref() {
+ gpr_mu_lock(&g_poller_mu);
if (gpr_unref(&g_poller->refs)) {
- gpr_mu_lock(&g_poller_mu);
backup_poller* p = g_poller;
g_poller = nullptr;
gpr_mu_unlock(&g_poller_mu);
@@ -94,6 +94,8 @@ static void g_poller_unref() {
grpc_schedule_on_exec_ctx));
gpr_mu_unlock(p->pollset_mu);
grpc_timer_cancel(&p->polling_timer);
+ } else {
+ gpr_mu_unlock(&g_poller_mu);
}
}