diff options
author | Ken Payson <kpayson@google.com> | 2017-10-10 11:18:49 -0700 |
---|---|---|
committer | Ken Payson <kpayson@google.com> | 2017-10-12 10:22:48 -0700 |
commit | 9714e0376a2890b850496c981694af5f91a49353 (patch) | |
tree | afa1e9b7fde0f7884b963b8380cbb07ecfbe136d /src/core/lib/surface | |
parent | 70d6041739c45d741e61b7d45762400bed5903a8 (diff) |
Add thread pool reset on fork with FORKING_SUPPORT_ENABLED
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r-- | src/core/lib/surface/init.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 <limits.h> #include <memory.h> +#include <grpc/fork.h> #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> @@ -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(); |