diff options
author | 2016-11-14 08:02:45 -0800 | |
---|---|---|
committer | 2016-11-14 08:02:45 -0800 | |
commit | 3cf79228ffcdd5c867b4067d6f6a5743a14d3ff1 (patch) | |
tree | 86778cc9c61666939677f67956a4f6539a79b6bf /src/core/lib/iomgr/iomgr.c | |
parent | d5a7a8a61eb3c1d5759f79c9cb4667a4d2df0d25 (diff) |
Review feedback
Diffstat (limited to 'src/core/lib/iomgr/iomgr.c')
-rw-r--r-- | src/core/lib/iomgr/iomgr.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/lib/iomgr/iomgr.c b/src/core/lib/iomgr/iomgr.c index 4fd83e0b22..8a233d0ba8 100644 --- a/src/core/lib/iomgr/iomgr.c +++ b/src/core/lib/iomgr/iomgr.c @@ -83,11 +83,10 @@ static void dump_objects(const char *kind) { } } -void grpc_iomgr_shutdown(void) { +void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx) { gpr_timespec shutdown_deadline = gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(10, GPR_TIMESPAN)); gpr_timespec last_warning_time = gpr_now(GPR_CLOCK_REALTIME); - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_iomgr_platform_flush(); @@ -104,10 +103,9 @@ void grpc_iomgr_shutdown(void) { } last_warning_time = gpr_now(GPR_CLOCK_REALTIME); } - if (grpc_timer_check(&exec_ctx, gpr_inf_future(GPR_CLOCK_MONOTONIC), - NULL)) { + if (grpc_timer_check(exec_ctx, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL)) { gpr_mu_unlock(&g_mu); - grpc_exec_ctx_flush(&exec_ctx); + grpc_exec_ctx_flush(exec_ctx); gpr_mu_lock(&g_mu); continue; } @@ -138,8 +136,8 @@ void grpc_iomgr_shutdown(void) { } gpr_mu_unlock(&g_mu); - grpc_timer_list_shutdown(&exec_ctx); - grpc_exec_ctx_finish(&exec_ctx); + grpc_timer_list_shutdown(exec_ctx); + grpc_exec_ctx_flush(exec_ctx); /* ensure all threads have left g_mu */ gpr_mu_lock(&g_mu); |