AcctIdx: combine scan and update loops (#20546)
This commit is contained in:
committed by
GitHub
parent
bdf8b1da6b
commit
33d8c07364
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user