pull/35787/head
yijiem 10 months ago
parent 610f439342
commit 703b8ae039
  1. 2
      src/core/lib/event_engine/forkable.cc

@ -43,6 +43,7 @@ bool IsForkEnabled() {
void ObjectGroupForkHandler::RegisterForkable( void ObjectGroupForkHandler::RegisterForkable(
std::shared_ptr<Forkable> forkable, GRPC_UNUSED void (*prepare)(void), std::shared_ptr<Forkable> forkable, GRPC_UNUSED void (*prepare)(void),
GRPC_UNUSED void (*parent)(void), GRPC_UNUSED void (*child)(void)) { GRPC_UNUSED void (*parent)(void), GRPC_UNUSED void (*child)(void)) {
if (IsForkEnabled()) {
GPR_ASSERT(!is_forking_); GPR_ASSERT(!is_forking_);
forkables_.emplace_back(forkable); forkables_.emplace_back(forkable);
#ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK #ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
@ -51,6 +52,7 @@ void ObjectGroupForkHandler::RegisterForkable(
} }
#endif // GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK #endif // GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
} }
}
void ObjectGroupForkHandler::Prefork() { void ObjectGroupForkHandler::Prefork() {
if (IsForkEnabled()) { if (IsForkEnabled()) {

Loading…
Cancel
Save