AcctIdx: combine scan and update loops (#20546)

This commit is contained in:
Jeff Washington (jwash)
2021-10-10 13:47:52 -05:00
committed by GitHub
parent bdf8b1da6b
commit 33d8c07364
3 changed files with 32 additions and 42 deletions

View File

@@ -184,6 +184,14 @@ impl<T: IndexValue> AccountMapEntryInner<T> {
self.meta.dirty.store(value, Ordering::Release)
}
/// set dirty to false, return true if was dirty
pub fn clear_dirty(&self) -> bool {
self.meta
.dirty
.compare_exchange(true, false, Ordering::AcqRel, Ordering::Relaxed)
.is_ok()
}
pub fn age(&self) -> Age {
self.meta.age.load(Ordering::Relaxed)
}