Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 29a3838

Browse files
Cloud Debugger Teamcopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 259605458 Change-Id: I468180cd0ba5a8d65bcb227dde25081137efc8ee
1 parent 153fce9 commit 29a3838

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/googleclouddebugger/leaky_bucket.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ class LeakyBucket {
6565

6666
// Atomically increment "tokens_".
6767
inline int64 AtomicIncrementTokens(int64 increment) {
68-
return tokens_ += increment;
68+
return tokens_.fetch_add(increment, std::memory_order_relaxed) + increment;
6969
}
7070

7171
// Atomically load the value of "tokens_".
7272
inline int64 AtomicLoadTokens() const {
73-
return tokens_;
73+
return tokens_.load(std::memory_order_relaxed);
7474
}
7575

7676
private:

0 commit comments

Comments
 (0)