update comment (#25949)

This commit is contained in:
Jeff Washington (jwash) 2022-06-13 17:43:29 -05:00 committed by GitHub
parent 734015115f
commit 306faed3a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -71,6 +71,7 @@ impl<T: IndexValue> BucketMapHolder<T> {
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.