aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2017-12-06 18:57:44 -0800
committerGravatar Alexander Polcyn <apolcyn@google.com>2017-12-07 09:59:15 -0800
commitf7a869fdbed6051b64a25d5bfc7228a7f4711219 (patch)
tree70a3a9ebabf8f56732900914e058fc5fbcc1293f /src/core
parent650595ea15f50dfee318fbe116be96afe0fab191 (diff)
Unref global backup poller under its lock
Diffstat (limited to 'src/core')
-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 ed437d255c..5b86e8631f 100644
--- a/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/src/core/ext/filters/client_channel/backup_poller.cc
@@ -83,8 +83,8 @@ static void done_poller(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
}
static void g_poller_unref(grpc_exec_ctx* exec_ctx) {
+ 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);
@@ -95,6 +95,8 @@ static void g_poller_unref(grpc_exec_ctx* exec_ctx) {
p, grpc_schedule_on_exec_ctx));
gpr_mu_unlock(p->pollset_mu);
grpc_timer_cancel(exec_ctx, &p->polling_timer);
+ } else {
+ gpr_mu_unlock(&g_poller_mu);
}
}