From 9714e0376a2890b850496c981694af5f91a49353 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Tue, 10 Oct 2017 11:18:49 -0700 Subject: Add thread pool reset on fork with FORKING_SUPPORT_ENABLED --- src/core/lib/surface/init.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/lib/surface') diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index b089da2c54..b04fa3d153 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -39,6 +40,8 @@ #include "src/core/lib/iomgr/timer_manager.h" #include "src/core/lib/profiling/timers.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/lib/support/fork.h" +#include "src/core/lib/support/thd_internal.h" #include "src/core/lib/surface/alarm_internal.h" #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/call.h" @@ -62,9 +65,11 @@ static int g_initializations; static void do_basic_init(void) { gpr_log_verbosity_init(); + grpc_fork_support_init(); gpr_mu_init(&g_init_mu); grpc_register_built_in_plugins(); g_initializations = 0; + grpc_fork_handlers_auto_register(); } static bool append_filter(grpc_exec_ctx *exec_ctx, @@ -121,6 +126,7 @@ void grpc_init(void) { gpr_mu_lock(&g_init_mu); if (++g_initializations == 1) { gpr_time_init(); + gpr_thd_init(); grpc_stats_init(); grpc_slice_intern_init(); grpc_mdctx_global_init(); -- cgit v1.2.3