From 306faed3a8e7407eba57c023a4e37252e04ae4b3 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Mon, 13 Jun 2022 17:43:29 -0500 Subject: [PATCH] update comment (#25949) --- runtime/src/bucket_map_holder.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/src/bucket_map_holder.rs b/runtime/src/bucket_map_holder.rs index b27179f9f..b6125c370 100644 --- a/runtime/src/bucket_map_holder.rs +++ b/runtime/src/bucket_map_holder.rs @@ -71,6 +71,7 @@ impl BucketMapHolder { pub fn increment_age(&self) { // since we are about to change age, there are now 0 buckets that have been flushed at this age // this should happen before the age.fetch_add + // Otherwise, as soon as we increment the age, a thread could race us and flush before we swap this out since it detects the age has moved forward and a bucket will be eligible for flushing. let previous = self.count_buckets_flushed.swap(0, Ordering::AcqRel); // fetch_add is defined to wrap. // That's what we want. 0..255, then back to 0.