diff options
author | Vijay Pai <vpai@google.com> | 2017-09-01 14:08:42 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2017-09-07 11:34:13 -0700 |
commit | 58c33ba19bcec079d0991822055f28e804540426 (patch) | |
tree | 57acb6a9069c5464898b63e0a531556ea5f19650 /src/core/lib/iomgr/timer.h | |
parent | 24f30f7ac0225530ae84dd064c683d7d11c3ac2b (diff) |
Decouple alarm construction from setting to avoid races in MT code
Diffstat (limited to 'src/core/lib/iomgr/timer.h')
-rw-r--r-- | src/core/lib/iomgr/timer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/timer.h b/src/core/lib/iomgr/timer.h index b92b8fb8b8..ac392f87fe 100644 --- a/src/core/lib/iomgr/timer.h +++ b/src/core/lib/iomgr/timer.h @@ -44,6 +44,10 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer, gpr_timespec deadline, grpc_closure *closure, gpr_timespec now); +/* Initialize *timer without setting it. This can later be passed through + the regular init or cancel */ +void grpc_timer_init_unset(grpc_timer *timer); + /* Note that there is no timer destroy function. This is because the timer is a one-time occurrence with a guarantee that the callback will be called exactly once, either at expiration or cancellation. Thus, all |