aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/exec_ctx.h
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2018-03-08 15:47:40 -0800
committerGravatar kpayson64 <kpayson@google.com>2018-04-30 17:40:59 -0700
commit38ab21ee0996a54c682488bcf43ecf5ba0f7f24a (patch)
treec65531bc89dd6916896c3dee0de1c6aab17819f1 /src/core/lib/iomgr/exec_ctx.h
parent8b875ac9413978370c4eafa2e2fb6a3b2f054297 (diff)
Add exec_ctx check to fork handlers
Diffstat (limited to 'src/core/lib/iomgr/exec_ctx.h')
-rw-r--r--src/core/lib/iomgr/exec_ctx.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h
index de97164f02..b5b59621f9 100644
--- a/src/core/lib/iomgr/exec_ctx.h
+++ b/src/core/lib/iomgr/exec_ctx.h
@@ -25,6 +25,7 @@
#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/iomgr/closure.h"
@@ -76,16 +77,23 @@ class ExecCtx {
public:
/** Default Constructor */
- ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) { Set(this); }
+ ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) {
+ grpc_fork_inc_exec_ctx_count();
+ Set(this);
+ }
/** Parameterised Constructor */
- ExecCtx(uintptr_t fl) : flags_(fl) { Set(this); }
+ ExecCtx(uintptr_t fl) : flags_(fl) {
+ grpc_fork_inc_exec_ctx_count();
+ Set(this);
+ }
/** Destructor */
virtual ~ExecCtx() {
flags_ |= GRPC_EXEC_CTX_FLAG_IS_FINISHED;
Flush();
Set(last_exec_ctx_);
+ grpc_fork_dec_exec_ctx_count();
}
/** Disallow copy and assignment operators */