aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/fork_posix.cc
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2018-04-30 17:40:00 -0700
committerGravatar kpayson64 <kpayson@google.com>2018-04-30 17:40:59 -0700
commit701e70da071ef91152c30aad813e2ed405c05c59 (patch)
tree10a6191128838bfb380d510567b2e047f6c9bb04 /src/core/lib/iomgr/fork_posix.cc
parent38ab21ee0996a54c682488bcf43ecf5ba0f7f24a (diff)
c++ify
Diffstat (limited to 'src/core/lib/iomgr/fork_posix.cc')
-rw-r--r--src/core/lib/iomgr/fork_posix.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/lib/iomgr/fork_posix.cc b/src/core/lib/iomgr/fork_posix.cc
index dd0f9f612f..b37384b8db 100644
--- a/src/core/lib/iomgr/fork_posix.cc
+++ b/src/core/lib/iomgr/fork_posix.cc
@@ -28,7 +28,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/gpr/env.h"
-#include "src/core/lib/gpr/fork.h"
+#include "src/core/lib/gprpp/fork.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/executor.h"
@@ -52,13 +52,13 @@ void grpc_prefork() {
if (!grpc_is_initialized()) {
return;
}
- if (!grpc_fork_support_enabled()) {
+ if (!grpc_core::Fork::Enabled()) {
gpr_log(GPR_ERROR,
"Fork support not enabled; try running with the "
"environment variable GRPC_ENABLE_FORK_SUPPORT=1");
return;
}
- if (!grpc_fork_block_exec_ctx()) {
+ if (!grpc_core::Fork::BlockExecCtx()) {
gpr_log(GPR_INFO,
"Other threads are currently calling into gRPC, skipping fork() "
"handlers");
@@ -67,13 +67,13 @@ void grpc_prefork() {
grpc_timer_manager_set_threading(false);
grpc_executor_set_threading(false);
grpc_core::ExecCtx::Get()->Flush();
- grpc_fork_await_thds();
+ grpc_core::Fork::AwaitThreads();
skipped_handler = false;
}
void grpc_postfork_parent() {
if (!skipped_handler) {
- grpc_fork_allow_exec_ctx();
+ grpc_core::Fork::AllowExecCtx();
grpc_core::ExecCtx exec_ctx;
grpc_timer_manager_set_threading(true);
grpc_executor_set_threading(true);
@@ -82,7 +82,7 @@ void grpc_postfork_parent() {
void grpc_postfork_child() {
if (!skipped_handler) {
- grpc_fork_allow_exec_ctx();
+ grpc_core::Fork::AllowExecCtx();
grpc_core::ExecCtx exec_ctx;
grpc_timer_manager_set_threading(true);
grpc_executor_set_threading(true);
@@ -90,7 +90,7 @@ void grpc_postfork_child() {
}
void grpc_fork_handlers_auto_register() {
- if (grpc_fork_support_enabled() & !registered_handlers) {
+ if (grpc_core::Fork::Enabled() & !registered_handlers) {
#ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
pthread_atfork(grpc_prefork, grpc_postfork_parent, grpc_postfork_child);
registered_handlers = true;