aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/fork_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/iomgr/fork_posix.cc')
-rw-r--r--src/core/lib/iomgr/fork_posix.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/core/lib/iomgr/fork_posix.cc b/src/core/lib/iomgr/fork_posix.cc
index f3cfd141b6..cc131408af 100644
--- a/src/core/lib/iomgr/fork_posix.cc
+++ b/src/core/lib/iomgr/fork_posix.cc
@@ -49,10 +49,10 @@ void grpc_prefork() {
return;
}
if (grpc_is_initialized()) {
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_core::ExecCtx exec_ctx;
grpc_timer_manager_set_threading(false);
- grpc_executor_set_threading(&exec_ctx, false);
- grpc_exec_ctx_finish(&exec_ctx);
+ grpc_executor_set_threading(false);
+ grpc_core::ExecCtx::Get()->Flush();
if (!gpr_await_threads(
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_seconds(3, GPR_TIMESPAN)))) {
@@ -64,18 +64,17 @@ void grpc_prefork() {
void grpc_postfork_parent() {
if (grpc_is_initialized()) {
grpc_timer_manager_set_threading(true);
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_executor_set_threading(&exec_ctx, true);
- grpc_exec_ctx_finish(&exec_ctx);
+ grpc_core::ExecCtx exec_ctx;
+ grpc_executor_set_threading(true);
}
}
void grpc_postfork_child() {
if (grpc_is_initialized()) {
grpc_timer_manager_set_threading(true);
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_executor_set_threading(&exec_ctx, true);
- grpc_exec_ctx_finish(&exec_ctx);
+ grpc_core::ExecCtx exec_ctx;
+ grpc_executor_set_threading(true);
+ grpc_core::ExecCtx::Get()->Flush();
}
}