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 128 of file NodeNetwork.cpp.

129{
130 if (channel_id >= 32)
131 return;
132
133 auto channel_bit = static_cast<uint32_t>(1ULL << channel_id);
134 uint32_t old_pending = m_pending_reset_mask.fetch_or(channel_bit,
135 std::memory_order_acq_rel);
136 uint32_t new_pending = old_pending | channel_bit;
137 uint32_t active_channels = m_channel_mask.load(std::memory_order_acquire);
138
139 if ((new_pending & active_channels) == active_channels && active_channels != 0) {
140 uint32_t expected = new_pending;
141 if (m_pending_reset_mask.compare_exchange_strong(expected, 0,
142 std::memory_order_acq_rel)) {
143 mark_processed(false);
144 }
145 }
146}
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: