From d0539dcc3693458f89e75a4f4d0d6534c40ebfa3 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Sun, 11 Nov 2018 22:50:42 -0800 Subject: [PATCH] Prevent dead-stripping by explicitly calling init --- src/core/lib/surface/init.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc index c6198b8ae76..6d58c78ffc4 100644 --- a/src/core/lib/surface/init.cc +++ b/src/core/lib/surface/init.cc @@ -114,8 +114,21 @@ void grpc_register_plugin(void (*init)(void), void (*destroy)(void)) { g_number_of_plugins++; } +// For debug of the timer manager crash only. +// TODO (mxyan): remove after bug is fixed. +#ifdef GRPC_DEBUG_TIMER_MANAGER +void init_debug_timer_manager(); +#endif + void grpc_init(void) { int i; + +// For debug of the timer manager crash only. +// TODO (mxyan): remove after bug is fixed. + #ifdef GRPC_DEBUG_TIMER_MANAGER + init_debug_timer_manager(); + #endif + gpr_once_init(&g_basic_init, do_basic_init); gpr_mu_lock(&g_init_mu);