diff options
author | 2018-04-30 17:40:00 -0700 | |
---|---|---|
committer | 2018-04-30 17:40:59 -0700 | |
commit | 701e70da071ef91152c30aad813e2ed405c05c59 (patch) | |
tree | 10a6191128838bfb380d510567b2e047f6c9bb04 /src/core/lib/iomgr | |
parent | 38ab21ee0996a54c682488bcf43ecf5ba0f7f24a (diff) |
c++ify
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r-- | src/core/lib/iomgr/exec_ctx.h | 8 | ||||
-rw-r--r-- | src/core/lib/iomgr/fork_posix.cc | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h index b5b59621f9..5eb4faaea3 100644 --- a/src/core/lib/iomgr/exec_ctx.h +++ b/src/core/lib/iomgr/exec_ctx.h @@ -25,8 +25,8 @@ #include <grpc/support/cpu.h> #include <grpc/support/log.h> -#include "src/core/lib/gpr/fork.h" #include "src/core/lib/gpr/tls.h" +#include "src/core/lib/gprpp/fork.h" #include "src/core/lib/iomgr/closure.h" typedef gpr_atm grpc_millis; @@ -78,13 +78,13 @@ class ExecCtx { /** Default Constructor */ ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) { - grpc_fork_inc_exec_ctx_count(); + grpc_core::Fork::IncExecCtxCount(); Set(this); } /** Parameterised Constructor */ ExecCtx(uintptr_t fl) : flags_(fl) { - grpc_fork_inc_exec_ctx_count(); + grpc_core::Fork::IncExecCtxCount(); Set(this); } @@ -93,7 +93,7 @@ class ExecCtx { flags_ |= GRPC_EXEC_CTX_FLAG_IS_FINISHED; Flush(); Set(last_exec_ctx_); - grpc_fork_dec_exec_ctx_count(); + grpc_core::Fork::DecExecCtxCount(); } /** Disallow copy and assignment operators */ 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; |