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

◆ push_lockfree()

template<typename T , typename StoragePolicy , typename ConcurrencyPolicy = SingleThreadedPolicy, typename AccessPattern = QueueAccess>
bool MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::push_lockfree ( const T &  value)
inlineprivatenoexcept

Definition at line 1136 of file RingBuffer.hpp.

1137 {
1138 const size_t cap = m_storage.capacity();
1139 auto write = m_state.write_index.load(std::memory_order_relaxed);
1140 auto next_write = State::increment(write, cap);
1141
1142 if (next_write == m_state.read_index.load(std::memory_order_acquire)) {
1143 return false;
1144 }
1145
1146 m_storage.buffer[write] = value;
1147 m_state.write_index.store(next_write, std::memory_order_release);
1148
1149 return true;
1150 }
float value

References MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::m_state, MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::m_storage, and value.

Referenced by MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::push().

+ Here is the caller graph for this function: