aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-06-02 23:04:37 +0000
committerGravatar Craig Tiller <ctiller@google.com>2017-06-02 23:04:37 +0000
commitcdb41dc0f3e72f955a00a677162af3952af04d83 (patch)
tree61c7e92fa3c3f46f56098d321ede27ec60a96a96 /src/core/lib/iomgr
parent2a505cbe633b30afd7b10d655e000617b4a4ede9 (diff)
Fixes
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r--src/core/lib/iomgr/timer_generic.c4
-rw-r--r--src/core/lib/iomgr/timer_manager.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/core/lib/iomgr/timer_generic.c b/src/core/lib/iomgr/timer_generic.c
index 288782c060..89f8a82d92 100644
--- a/src/core/lib/iomgr/timer_generic.c
+++ b/src/core/lib/iomgr/timer_generic.c
@@ -433,7 +433,7 @@ static grpc_timer_check_result run_some_expired_timers(grpc_exec_ctx *exec_ctx,
gpr_tls_set(&g_last_seen_min_timer, min_timer);
if (now < min_timer) {
if (next != NULL) *next = GPR_MIN(*next, min_timer);
- return 0;
+ return GRPC_TIMERS_CHECKED_AND_EMPTY;
}
if (gpr_spinlock_trylock(&g_shared_mutables.checker_mu)) {
@@ -553,7 +553,7 @@ grpc_timer_check_result grpc_timer_check(grpc_exec_ctx *exec_ctx,
gpr_asprintf(&next_str, "%" PRId64 ".%09d [%" PRIdPTR "]", next->tv_sec,
next->tv_nsec, next_atm);
}
- gpr_log(GPR_DEBUG, "TIMER CHECK END: %d timers triggered; next=%s", r,
+ gpr_log(GPR_DEBUG, "TIMER CHECK END: r=%d; next=%s", r,
next_str);
gpr_free(next_str);
}
diff --git a/src/core/lib/iomgr/timer_manager.c b/src/core/lib/iomgr/timer_manager.c
index 5fb3102f38..8e913f1739 100644
--- a/src/core/lib/iomgr/timer_manager.c
+++ b/src/core/lib/iomgr/timer_manager.c
@@ -158,7 +158,8 @@ static bool wait_until(gpr_timespec next) {
// figure stuff out instead of incurring a wakeup)
my_timed_waiter_generation = ++g_timed_waiter_generation;
if (GRPC_TRACER_ON(grpc_timer_check_trace)) {
- gpr_log(GPR_DEBUG, "sleep for a while");
+ gpr_timespec wait_time = gpr_time_sub(next, gpr_now(GPR_CLOCK_MONOTONIC));
+ gpr_log(GPR_DEBUG, "sleep for a %" PRId64 ".%09d seconds", wait_time.tv_sec, wait_time.tv_nsec);
}
} else {
next = inf_future;
@@ -207,6 +208,9 @@ static void timer_main_loop(grpc_exec_ctx *exec_ctx) {
Consequently, we can just sleep forever here and be happy at some
saved wakeup cycles. */
+ if (GRPC_TRACER_ON(grpc_timer_check_trace)) {
+ gpr_log(GPR_DEBUG, "timers not checked: expect another thread to");
+ }
next = inf_future;
/* fall through */
case GRPC_TIMERS_CHECKED_AND_EMPTY: