Test failure fixes

pull/14647/head
kpayson64 7 years ago
parent 701e70da07
commit 3cced83d2c
  1. 24
      src/core/lib/gprpp/fork.cc
  2. 6
      src/core/lib/gprpp/fork.h

@ -225,12 +225,28 @@ bool Fork::BlockExecCtx() {
return false; 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::DecThreadCount() {
void Fork::AwaitThreads() { threadState_->AwaitThreads(); } if (supportEnabled_) {
threadState_->DecThreadCount();
}
}
void Fork::AwaitThreads() {
if (supportEnabled_) {
threadState_->AwaitThreads();
}
}
internal::ExecCtxState* Fork::execCtxState_ = nullptr; internal::ExecCtxState* Fork::execCtxState_ = nullptr;
internal::ThreadState* Fork::threadState_ = nullptr; internal::ThreadState* Fork::threadState_ = nullptr;

@ -16,8 +16,8 @@
* *
*/ */
#ifndef GRPC_CORE_LIB_GPR_FORK_H #ifndef GRPC_CORE_LIB_GPRPP_FORK_H
#define GRPC_CORE_LIB_GPR_FORK_H #define GRPC_CORE_LIB_GPRPP_FORK_H
/* /*
* NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK * NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK
@ -76,4 +76,4 @@ class Fork {
} // namespace grpc_core } // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPR_FORK_H */ #endif /* GRPC_CORE_LIB_GPRPP_FORK_H */

Loading…
Cancel
Save