aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/gprpp
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2018-05-11 10:51:46 -0700
committerGravatar kpayson64 <kpayson@google.com>2018-05-11 10:51:46 -0700
commit3cced83d2cace449485498537f5ec01a2432cdce (patch)
tree60b49844104a56edd63b9c70de29875434984553 /src/core/lib/gprpp
parent701e70da071ef91152c30aad813e2ed405c05c59 (diff)
Test failure fixes
Diffstat (limited to 'src/core/lib/gprpp')
-rw-r--r--src/core/lib/gprpp/fork.cc24
-rw-r--r--src/core/lib/gprpp/fork.h6
2 files changed, 23 insertions, 7 deletions
diff --git a/src/core/lib/gprpp/fork.cc b/src/core/lib/gprpp/fork.cc
index 78f6a2fa0d..ddc95f26eb 100644
--- a/src/core/lib/gprpp/fork.cc
+++ b/src/core/lib/gprpp/fork.cc
@@ -225,12 +225,28 @@ bool Fork::BlockExecCtx() {
return false;
}
-void Fork::AllowExecCtx() { execCtxState_->AllowExecCtx(); }
+void Fork::AllowExecCtx() {
+ if (supportEnabled_) {
+ execCtxState_->AllowExecCtx();
+ }
+}
-void Fork::IncThreadCount() { threadState_->IncThreadCount(); }
+void Fork::IncThreadCount() {
+ if (supportEnabled_) {
+ threadState_->IncThreadCount();
+ }
+}
-void Fork::DecThreadCount() { threadState_->DecThreadCount(); }
-void Fork::AwaitThreads() { threadState_->AwaitThreads(); }
+void Fork::DecThreadCount() {
+ if (supportEnabled_) {
+ threadState_->DecThreadCount();
+ }
+}
+void Fork::AwaitThreads() {
+ if (supportEnabled_) {
+ threadState_->AwaitThreads();
+ }
+}
internal::ExecCtxState* Fork::execCtxState_ = nullptr;
internal::ThreadState* Fork::threadState_ = nullptr;
diff --git a/src/core/lib/gprpp/fork.h b/src/core/lib/gprpp/fork.h
index 830bb6b505..60ed74b1fb 100644
--- a/src/core/lib/gprpp/fork.h
+++ b/src/core/lib/gprpp/fork.h
@@ -16,8 +16,8 @@
*
*/
-#ifndef GRPC_CORE_LIB_GPR_FORK_H
-#define GRPC_CORE_LIB_GPR_FORK_H
+#ifndef GRPC_CORE_LIB_GPRPP_FORK_H
+#define GRPC_CORE_LIB_GPRPP_FORK_H
/*
* NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK
@@ -76,4 +76,4 @@ class Fork {
} // namespace grpc_core
-#endif /* GRPC_CORE_LIB_GPR_FORK_H */
+#endif /* GRPC_CORE_LIB_GPRPP_FORK_H */