aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-11-09 21:26:06 -0800
committerGravatar Muxi Yan <mxyan@google.com>2017-11-09 21:26:06 -0800
commitaa2ab1fd9896d1be27451d91d02b9a72de18cf08 (patch)
tree0dc61c67b2faeafb48f05790e922fad24bce8584 /src/core
parent830c14ff9b32cd83eae48f239b0009b3b0045ddd (diff)
Polish invalidation of
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/iomgr/exec_ctx.cc1
-rw-r--r--src/core/lib/iomgr/timer_manager.cc4
2 files changed, 2 insertions, 3 deletions
diff --git a/src/core/lib/iomgr/exec_ctx.cc b/src/core/lib/iomgr/exec_ctx.cc
index b9e43c6cce..79ce33fa56 100644
--- a/src/core/lib/iomgr/exec_ctx.cc
+++ b/src/core/lib/iomgr/exec_ctx.cc
@@ -184,7 +184,6 @@ grpc_millis grpc_timespec_to_millis_round_up(gpr_timespec ts) {
}
void grpc_exec_ctx_maybe_update_start_time(grpc_exec_ctx* exec_ctx) {
- grpc_exec_ctx_invalidate_now(exec_ctx);
grpc_millis now = grpc_exec_ctx_now(exec_ctx);
grpc_millis last_start_time_update = gpr_atm_acq_load(&g_last_start_time_update);
if (now > last_start_time_update &&
diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc
index 6814bcd1ce..3de87cbf60 100644
--- a/src/core/lib/iomgr/timer_manager.cc
+++ b/src/core/lib/iomgr/timer_manager.cc
@@ -224,11 +224,11 @@ static bool wait_until(grpc_exec_ctx* exec_ctx, grpc_millis next) {
static void timer_main_loop(grpc_exec_ctx* exec_ctx) {
for (;;) {
grpc_millis next = GRPC_MILLIS_INF_FUTURE;
+ grpc_exec_ctx_invalidate_now(exec_ctx);
+
// Check if it is time to update g_start_time
grpc_exec_ctx_maybe_update_start_time(exec_ctx);
- grpc_exec_ctx_invalidate_now(exec_ctx);
-
// check timer state, updates next to the next time to run a check
switch (grpc_timer_check(exec_ctx, &next)) {
case GRPC_TIMERS_FIRED: