#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/fork.h"
#include <grpc/support/atm.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/lib/event_engine/thread_local.h"
#include "src/core/lib/gprpp/global_config_env.h"
#include "src/core/lib/gprpp/no_destruct.h"
#ifdef GRPC_ENABLE_FORK_SUPPORT
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT …
#else
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT …
#endif
GPR_GLOBAL_CONFIG_DEFINE_BOOL(grpc_enable_fork_support,
GRPC_ENABLE_FORK_SUPPORT_DEFAULT,
"Enable fork support");
namespace grpc_core {
namespace {
#define UNBLOCKED(n) …
#define BLOCKED(n) …
class ExecCtxState { … };
class ThreadState { … };
}
void Fork::GlobalInit() { … }
bool Fork::Enabled() { … }
void Fork::Enable(bool enable) { … }
void Fork::DoIncExecCtxCount() { … }
void Fork::DoDecExecCtxCount() { … }
void Fork::SetResetChildPollingEngineFunc(
Fork::child_postfork_func reset_child_polling_engine) { … }
const std::vector<Fork::child_postfork_func>&
Fork::GetResetChildPollingEngineFunc() { … }
bool Fork::BlockExecCtx() { … }
void Fork::AllowExecCtx() { … }
void Fork::IncThreadCount() { … }
void Fork::DecThreadCount() { … }
void Fork::AwaitThreads() { … }
std::atomic<bool> Fork::support_enabled_(false);
bool Fork::override_enabled_ = …;
std::vector<Fork::child_postfork_func>* Fork::reset_child_polling_engine_ = …;
}