aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/backoff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/backoff')
-rw-r--r--src/core/lib/backoff/backoff.cc8
-rw-r--r--src/core/lib/backoff/backoff.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core/lib/backoff/backoff.cc b/src/core/lib/backoff/backoff.cc
index 500b3d6a8a..41f625a636 100644
--- a/src/core/lib/backoff/backoff.cc
+++ b/src/core/lib/backoff/backoff.cc
@@ -47,12 +47,12 @@ BackOff::BackOff(const Options& options) : options_(options) {
rng_state_ = static_cast<uint32_t>(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
}
-grpc_millis BackOff::Begin(grpc_exec_ctx* exec_ctx) {
+grpc_millis BackOff::Begin() {
current_backoff_ = options_.initial_backoff();
- return current_backoff_ + grpc_exec_ctx_now(exec_ctx);
+ return current_backoff_ + grpc_core::ExecCtx::Get()->Now();
}
-grpc_millis BackOff::Step(grpc_exec_ctx* exec_ctx) {
+grpc_millis BackOff::Step() {
current_backoff_ =
(grpc_millis)(std::min(current_backoff_ * options_.multiplier(),
(double)options_.max_backoff()));
@@ -60,7 +60,7 @@ grpc_millis BackOff::Step(grpc_exec_ctx* exec_ctx) {
&rng_state_, -options_.jitter() * current_backoff_,
options_.jitter() * current_backoff_);
const grpc_millis next_timeout = (grpc_millis)(current_backoff_ + jitter);
- return next_timeout + grpc_exec_ctx_now(exec_ctx);
+ return next_timeout + grpc_core::ExecCtx::Get()->Now();
}
void BackOff::Reset() { current_backoff_ = options_.initial_backoff(); }
diff --git a/src/core/lib/backoff/backoff.h b/src/core/lib/backoff/backoff.h
index 6f2c30d42f..84ef9b82e4 100644
--- a/src/core/lib/backoff/backoff.h
+++ b/src/core/lib/backoff/backoff.h
@@ -34,10 +34,10 @@ class BackOff {
/// Begin retry loop: returns the deadline to be used for the next attempt,
/// following the backoff strategy.
- grpc_millis Begin(grpc_exec_ctx* exec_ctx);
+ grpc_millis Begin();
/// Step a retry loop: returns the deadline to be used for the next attempt,
/// following the backoff strategy.
- grpc_millis Step(grpc_exec_ctx* exec_ctx);
+ grpc_millis Step();
/// Reset the backoff, so the next grpc_backoff_step will be a
/// grpc_backoff_begin.
void Reset();