6#ifndef BITCOIN_UTIL_EPOCHGUARD_H
7#define BITCOIN_UTIL_EPOCHGUARD_H
38 bool m_guarded =
false;
48 bool guarded()
const {
return m_guarded; }
87 if (
marker.m_marker < m_raw_epoch) {
89 marker.m_marker = m_raw_epoch;
97#define WITH_FRESH_EPOCH(epoch) \
98 const Epoch::Guard UNIQUE_NAME(epoch_guard_)(epoch)
~Guard() UNLOCK_FUNCTION()
Guard(Epoch &epoch) EXCLUSIVE_LOCK_FUNCTION(epoch)
Marker & operator=(Marker &&)=delete
Marker & operator=(const Marker &)=delete
Marker(const Marker &)=default
Epoch: RAII-style guard for using epoch-based graph traversal algorithms.
Epoch(const Epoch &)=delete
Epoch & operator=(Epoch &&)=delete
bool visited(Marker &marker) const EXCLUSIVE_LOCKS_REQUIRED(*this)
Epoch & operator=(const Epoch &)=delete
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
#define EXCLUSIVE_LOCKS_REQUIRED(...)
#define EXCLUSIVE_LOCK_FUNCTION(...)
#define UNLOCK_FUNCTION(...)