MayaFlux 0.2.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 107 of file NodeNetwork.cpp.

108{
109 if (channel_id >= 32)
110 return;
111
112 auto channel_bit = static_cast<uint32_t>(1ULL << channel_id);
113 uint32_t old_pending = m_pending_reset_mask.fetch_or(channel_bit,
114 std::memory_order_acq_rel);
115 uint32_t new_pending = old_pending | channel_bit;
116 uint32_t active_channels = m_channel_mask.load(std::memory_order_acquire);
117
118 if ((new_pending & active_channels) == active_channels && active_channels != 0) {
119 uint32_t expected = new_pending;
120 if (m_pending_reset_mask.compare_exchange_strong(expected, 0,
121 std::memory_order_acq_rel)) {
122 mark_processed(false);
123 }
124 }
125}
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: