diff options
author | 2018-08-28 12:55:40 -0700 | |
---|---|---|
committer | 2018-08-28 12:55:40 -0700 | |
commit | 6076b1d7982b4d0778dd68c236075b5c36b72e0d (patch) | |
tree | 1da2c80065a6844ca0480bd83217792cc3185886 /src/core/lib/gprpp/fork.h | |
parent | 3f002567c4c1f8cc7542aeee2d60d6d0c4c5dd54 (diff) | |
parent | 4b5b019d5644affef122e06c6898811286850b8d (diff) |
Merge branch 'channelz-subchannels' into channelz-server
Diffstat (limited to 'src/core/lib/gprpp/fork.h')
-rw-r--r-- | src/core/lib/gprpp/fork.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/core/lib/gprpp/fork.h b/src/core/lib/gprpp/fork.h index 123e22c4c6..5a7404f0d9 100644 --- a/src/core/lib/gprpp/fork.h +++ b/src/core/lib/gprpp/fork.h @@ -33,6 +33,8 @@ class ThreadState; class Fork { public: + typedef void (*child_postfork_func)(void); + static void GlobalInit(); static void GlobalShutdown(); @@ -46,6 +48,12 @@ class Fork { // Decrement the count of active ExecCtxs static void DecExecCtxCount(); + // Provide a function that will be invoked in the child's postfork handler to + // reset the polling engine's internal state. + static void SetResetChildPollingEngineFunc( + child_postfork_func reset_child_polling_engine); + static child_postfork_func GetResetChildPollingEngineFunc(); + // Check if there is a single active ExecCtx // (the one used to invoke this function). If there are more, // return false. Otherwise, return true and block creation of @@ -68,10 +76,11 @@ class Fork { static void Enable(bool enable); private: - static internal::ExecCtxState* execCtxState_; - static internal::ThreadState* threadState_; - static bool supportEnabled_; - static bool overrideEnabled_; + 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_; }; } // namespace grpc_core |