aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/backup_poller.cc
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2017-10-05 23:31:26 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2017-10-30 12:06:52 -0700
commit223f8d412be6713b6d12e4ef9076b4bb33b149a8 (patch)
tree0b0c73280c6010cbdce1a7f1a9191154f13ab939 /src/core/ext/filters/client_channel/backup_poller.cc
parentdd77922d271684b64908493181b2bb0559d97c96 (diff)
Remove schedule_polling_timer
Diffstat (limited to 'src/core/ext/filters/client_channel/backup_poller.cc')
-rw-r--r--src/core/ext/filters/client_channel/backup_poller.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/ext/filters/client_channel/backup_poller.cc b/src/core/ext/filters/client_channel/backup_poller.cc
index 9d6719d47c..e9bae13056 100644
--- a/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/src/core/ext/filters/client_channel/backup_poller.cc
@@ -89,13 +89,6 @@ static void g_poller_unref(grpc_exec_ctx* exec_ctx) {
}
}
-static void schedule_polling_timer(gpr_timespec now) {
- grpc_timer_init(
- exec_ctx, &p->polling_timer,
- gpr_time_add(now, gpr_time_from_millis(g_poll_interval_ms, GPR_TIMESPAN)),
- &p->run_poller_closure, now);
-}
-
static void run_poller(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
backup_poller* p = (backup_poller*)arg;
if (error != GRPC_ERROR_NONE) {
@@ -111,7 +104,10 @@ static void run_poller(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
gpr_inf_past(GPR_CLOCK_MONOTONIC));
gpr_mu_unlock(p->pollset_mu);
GRPC_LOG_IF_ERROR("Run client channel backup poller", err);
- schedule_polling_timer(now);
+ grpc_timer_init(
+ exec_ctx, &p->polling_timer,
+ gpr_time_add(now, gpr_time_from_millis(g_poll_interval_ms, GPR_TIMESPAN)),
+ &p->run_poller_closure, now);
}
void grpc_client_channel_start_backup_polling(
@@ -130,7 +126,11 @@ void grpc_client_channel_start_backup_polling(
gpr_ref_init(&g_poller->shutdown_refs, 2);
GRPC_CLOSURE_INIT(&g_poller->run_poller_closure, run_poller, g_poller,
grpc_schedule_on_exec_ctx);
- schedule_polling_timer(gpr_now(GPR_CLOCK_MONOTONIC));
+ gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
+ grpc_timer_init(exec_ctx, &g_poller->polling_timer,
+ gpr_time_add(now, gpr_time_from_millis(g_poll_interval_ms,
+ GPR_TIMESPAN)),
+ &g_poller->run_poller_closure, now);
}
gpr_ref(&g_poller->refs);
gpr_mu_unlock(&g_poller_mu);