#ifndef GRPC_CORE_LIB_GPRPP_FORK_H
#define GRPC_CORE_LIB_GPRPP_FORK_H
namespace grpc_core {
namespace internal {
class ExecCtxState;
class ThreadState;
}
class Fork {
public:
typedef void (*child_postfork_func)(void);
static void GlobalInit();
static void GlobalShutdown();
static bool Enabled();
static void IncExecCtxCount();
static void DecExecCtxCount();
static void SetResetChildPollingEngineFunc(
child_postfork_func reset_child_polling_engine);
static child_postfork_func GetResetChildPollingEngineFunc();
static bool BlockExecCtx();
static void AllowExecCtx();
static void IncThreadCount();
static void DecThreadCount();
static void AwaitThreads();
static void Enable(bool enable);
private:
static internal::ExecCtxState* exec_ctx_state_;
static internal::ThreadState* thread_state_;
static bool support_enabled_;
static bool override_enabled_;
static child_postfork_func reset_child_polling_engine_;
};
}
#endif