MayaFlux 0.3.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 117 of file NodeNetwork.cpp.

118{
119 if (channel_id >= 32)
120 return;
121
122 auto channel_bit = static_cast<uint32_t>(1ULL << channel_id);
123 uint32_t old_pending = m_pending_reset_mask.fetch_or(channel_bit,
124 std::memory_order_acq_rel);
125 uint32_t new_pending = old_pending | channel_bit;
126 uint32_t active_channels = m_channel_mask.load(std::memory_order_acquire);
127
128 if ((new_pending & active_channels) == active_channels && active_channels != 0) {
129 uint32_t expected = new_pending;
130 if (m_pending_reset_mask.compare_exchange_strong(expected, 0,
131 std::memory_order_acq_rel)) {
132 mark_processed(false);
133 }
134 }
135}
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: