diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-11-22 16:03:32 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-11-22 16:59:56 -0800 |
commit | eaf67dbdf67821b76e67066f201f2fafe1f5859c (patch) | |
tree | 5332cad696c25e36868f437b4e1c357c25a550de /src/core/lib/iomgr/exec_ctx.cc | |
parent | a13a8c0f3ea9bdf70680c0c8b5667186c832a412 (diff) |
Fixing errors and minor bugs
Diffstat (limited to 'src/core/lib/iomgr/exec_ctx.cc')
-rw-r--r-- | src/core/lib/iomgr/exec_ctx.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/core/lib/iomgr/exec_ctx.cc b/src/core/lib/iomgr/exec_ctx.cc index 4bd92a4141..25ff686188 100644 --- a/src/core/lib/iomgr/exec_ctx.cc +++ b/src/core/lib/iomgr/exec_ctx.cc @@ -108,6 +108,13 @@ namespace grpc_core { thread_local ExecCtx* ExecCtx::exec_ctx_ = nullptr; #endif +void ExecCtx::GlobalInit(void) { + g_start_time = gpr_now(GPR_CLOCK_MONOTONIC); +#ifdef GPR_PTHREAD_TLS + gpr_tls_init(&exec_ctx_); +#endif +} + bool ExecCtx::Flush() { bool did_something = 0; GPR_TIMER_BEGIN("grpc_exec_ctx_flush", 0); @@ -131,19 +138,6 @@ bool ExecCtx::Flush() { return did_something; } -void ExecCtx::GlobalInit(void) { - g_start_time = gpr_now(GPR_CLOCK_MONOTONIC); -#ifdef GPR_PTHREAD_TLS - gpr_tls_init(&exec_ctx_); -#endif -} - -void ExecCtx::GlobalShutdown(void) { -#ifdef GPR_PTHREAD_TLS - gpr_tls_destroy(&exec_ctx_); -#endif -} - grpc_millis ExecCtx::Now() { if (!now_is_valid_) { now_ = timespec_to_atm_round_down(gpr_now(GPR_CLOCK_MONOTONIC)); |