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

◆ request_reset_from_channel()

void MayaFlux::Nodes::Network::NodeNetwork::request_reset_from_channel ( uint32_t  channel_id)

Request a reset from a specific channel.

Parameters
channel_idChannel index

Definition at line 181 of file NodeNetwork.cpp.

182{
183 if (channel_id >= 32)
184 return;
185
186 auto channel_bit = static_cast<uint32_t>(1ULL << channel_id);
187 uint32_t old_pending = m_pending_reset_mask.fetch_or(channel_bit,
188 std::memory_order_acq_rel);
189 uint32_t new_pending = old_pending | channel_bit;
190 uint32_t active_channels = m_channel_mask.load(std::memory_order_acquire);
191
192 if ((new_pending & active_channels) == active_channels && active_channels != 0) {
193 uint32_t expected = new_pending;
194 if (m_pending_reset_mask.compare_exchange_strong(expected, 0,
195 std::memory_order_acq_rel)) {
196 mark_processed(false);
197 }
198 }
199}
void mark_processed(bool processed)
Mark network as processed this cycle (lock-free)
std::atomic< uint32_t > m_channel_mask
Bitfield of channels this network is registered on.
std::atomic< uint32_t > m_pending_reset_mask

References m_channel_mask, m_pending_reset_mask, and mark_processed().

+ Here is the call graph for this function: