MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ read_begin()

uint32_t MayaFlux::Memory::Seqlock::read_begin ( ) const
inlinenoexcept

Begin a read: spin until the counter is even, return the snapshot.

The caller reads the guarded data after this returns, then calls read_retry() to verify no write overlapped.

Returns
Even sequence snapshot to pass to read_retry().

Definition at line 82 of file SeqLock.hpp.

83 {
84 uint32_t v {};
85 do {
86 v = m_seq.load(std::memory_order_acquire);
87 } while (v & 1U);
88 return v;
89 }
std::atomic< uint32_t > m_seq
Definition SeqLock.hpp:115

References m_seq.

Referenced by MayaFlux::Memory::seqlock_read_void().

+ Here is the caller graph for this function: