struct EvictionsGuard<'a> {
stop_evictions: &'a AtomicU64,
num_state_changes: &'a AtomicU64,
storage_notifier: &'a WaitableCondvar,
}
Expand description
Disable (and safely enable) the background flusher from evicting entries from the in-mem accounts index. When disabled, no entries may be evicted. When enabled, only eligible entries may be evicted (i.e. those not in a held range).
An RAII implementation of a scoped lock for the stop_evictions
atomic flag/counter in
InMemAccountsIndex
. When this structure is dropped (falls out of scope), the counter will
decrement and conditionally notify its storage.
After successfully locking (calling EvictionsGuard::lock()
), pass a reference to the
EvictionsGuard
instance to any function/code that requires stop_evictions
to be
incremented/decremented correctly.
Fields§
§stop_evictions: &'a AtomicU64
The number of active callers disabling evictions
num_state_changes: &'a AtomicU64
The number of times that evictions have been disabled or enabled
storage_notifier: &'a WaitableCondvar
Who will be notified after the evictions are re-enabled