diff options
Diffstat (limited to 'src/core/lib/iomgr/timer_uv.cc')
-rw-r--r-- | src/core/lib/iomgr/timer_uv.cc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc index ccbbe357ae..b3e1ef372f 100644 --- a/src/core/lib/iomgr/timer_uv.cc +++ b/src/core/lib/iomgr/timer_uv.cc @@ -45,28 +45,28 @@ static void stop_uv_timer(uv_timer_t *handle) { void run_expired_timer(uv_timer_t *handle) { grpc_timer *timer = (grpc_timer *)handle->data; - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + ExecCtx _local_exec_ctx; GRPC_UV_ASSERT_SAME_THREAD(); GPR_ASSERT(timer->pending); timer->pending = 0; - GRPC_CLOSURE_SCHED(&exec_ctx, timer->closure, GRPC_ERROR_NONE); + GRPC_CLOSURE_SCHED(timer->closure, GRPC_ERROR_NONE); stop_uv_timer(handle); - grpc_exec_ctx_finish(&exec_ctx); + grpc_exec_ctx_finish(); } -void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer, - grpc_millis deadline, grpc_closure *closure) { +void grpc_timer_init(grpc_timer *timer, grpc_millis deadline, + grpc_closure *closure) { uint64_t timeout; uv_timer_t *uv_timer; GRPC_UV_ASSERT_SAME_THREAD(); timer->closure = closure; - if (deadline <= grpc_exec_ctx_now(exec_ctx)) { + if (deadline <= grpc_exec_ctx_now()) { timer->pending = 0; - GRPC_CLOSURE_SCHED(exec_ctx, timer->closure, GRPC_ERROR_NONE); + GRPC_CLOSURE_SCHED(timer->closure, GRPC_ERROR_NONE); return; } timer->pending = 1; - timeout = (uint64_t)(deadline - grpc_exec_ctx_now(exec_ctx)); + timeout = (uint64_t)(deadline - grpc_exec_ctx_now()); uv_timer = (uv_timer_t *)gpr_malloc(sizeof(uv_timer_t)); uv_timer_init(uv_default_loop(), uv_timer); uv_timer->data = timer; @@ -80,22 +80,21 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer, void grpc_timer_init_unset(grpc_timer *timer) { timer->pending = 0; } -void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer) { +void grpc_timer_cancel(grpc_timer *timer) { GRPC_UV_ASSERT_SAME_THREAD(); if (timer->pending) { timer->pending = 0; - GRPC_CLOSURE_SCHED(exec_ctx, timer->closure, GRPC_ERROR_CANCELLED); + GRPC_CLOSURE_SCHED(timer->closure, GRPC_ERROR_CANCELLED); stop_uv_timer((uv_timer_t *)timer->uv_timer); } } -grpc_timer_check_result grpc_timer_check(grpc_exec_ctx *exec_ctx, - grpc_millis *next) { +grpc_timer_check_result grpc_timer_check(grpc_millis *next) { return GRPC_TIMERS_NOT_CHECKED; } -void grpc_timer_list_init(grpc_exec_ctx *exec_ctx) {} -void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx) {} +void grpc_timer_list_init() {} +void grpc_timer_list_shutdown() {} void grpc_timer_consume_kick(void) {} |