pull/36932/head
Craig Tiller 9 months ago
parent 9954dbacfc
commit ba41f5a63f
  1. 5
      src/core/lib/resource_quota/periodic_update.cc

@ -56,8 +56,9 @@ bool PeriodicUpdate::MaybeEndPeriod(absl::FunctionRef<void(Duration)> f) {
// Store the remainder left. Note that updates_remaining_ may have been
// decremented by another thread whilst we performed the above calculations:
// we simply discard those decrements.
updates_remaining_.store(better_guess - expected_updates_per_period_,
std::memory_order_release);
auto remaining = better_guess - expected_updates_per_period_;
expected_updates_per_period_ = better_guess;
updates_remaining_.store(remaining, std::memory_order_release);
// Not quite done, return, try for longer.
return false;
}

Loading…
Cancel
Save