diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-11-13 15:37:58 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-11-14 01:36:28 -0800 |
commit | 75122c23578e24417dcf64081c737571a9fc2dbc (patch) | |
tree | f4b8491964ec0508a5826490628c9f87b82c3326 /src/core/lib/iomgr/ev_epoll1_linux.cc | |
parent | 36cd68f0d543b9024c84eff82319890a791de7f6 (diff) |
Address some PR comments
Diffstat (limited to 'src/core/lib/iomgr/ev_epoll1_linux.cc')
-rw-r--r-- | src/core/lib/iomgr/ev_epoll1_linux.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 31f51df15d..2b486887b8 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -554,7 +554,7 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) { static int poll_deadline_to_millis_timeout(grpc_millis millis) { if (millis == GRPC_MILLIS_INF_FUTURE) return -1; - grpc_millis delta = millis - grpc_exec_ctx_now(); + grpc_millis delta = millis - ExecCtx::Get()->Now(); if (delta > INT_MAX) { return INT_MAX; } else if (delta < 0) { @@ -630,7 +630,7 @@ static grpc_error* do_epoll_wait(grpc_pollset* ps, grpc_millis deadline) { timeout); } while (r < 0 && errno == EINTR); if (timeout != 0) { - GRPC_SCHEDULING_END_BLOCKING_REGION_WITH_EXEC_CTX(); + GRPC_SCHEDULING_END_BLOCKING_REGION; } if (r < 0) return GRPC_OS_ERROR(errno, "epoll_wait"); @@ -743,7 +743,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, SET_KICK_STATE(worker, KICKED); } } - grpc_exec_ctx_invalidate_now(); + ExecCtx::Get()->InvalidateNow(); } if (GRPC_TRACER_ON(grpc_polling_trace)) { @@ -848,7 +848,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, /* Make sure we appear kicked */ SET_KICK_STATE(worker, KICKED); grpc_closure_list_move(&worker->schedule_on_end_work, - &exec_ctx->closure_list); + ExecCtx::Get()->closure_list()); if (gpr_atm_no_barrier_load(&g_active_poller) == (gpr_atm)worker) { if (worker->next != worker && worker->next->state == UNKICKED) { if (GRPC_TRACER_ON(grpc_polling_trace)) { @@ -859,9 +859,9 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, SET_KICK_STATE(worker->next, DESIGNATED_POLLER); GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(); gpr_cv_signal(&worker->next->cv); - if (grpc_exec_ctx_has_work()) { + if (ExecCtx::Get()->HasWork()) { gpr_mu_unlock(&pollset->mu); - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); gpr_mu_lock(&pollset->mu); } } else { @@ -892,12 +892,12 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, found_worker = check_neighborhood_for_available_poller(neighborhood); gpr_mu_unlock(&neighborhood->mu); } - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); gpr_mu_lock(&pollset->mu); } - } else if (grpc_exec_ctx_has_work()) { + } else if (ExecCtx::Get()->HasWork()) { gpr_mu_unlock(&pollset->mu); - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); gpr_mu_lock(&pollset->mu); } if (worker->initialized_cv) { @@ -948,9 +948,9 @@ static grpc_error* pollset_work(grpc_pollset* ps, process_epoll_events() returns very quickly: It just queues the work on exec_ctx but does not execute it (the actual exectution or more - accurately grpc_exec_ctx_flush() happens in end_worker() AFTER selecting - a designated poller). So we are not waiting long periods without a - designated poller */ + accurately ExecCtx::Get()->Flush() happens in end_worker() AFTER + selecting a designated poller). So we are not waiting long periods + without a designated poller */ if (gpr_atm_acq_load(&g_epoll_set.cursor) == gpr_atm_acq_load(&g_epoll_set.num_events)) { append_error(&error, do_epoll_wait(ps, deadline), err_desc); |