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

◆ refresh_channel_bit()

void MayaFlux::Nodes::Node::refresh_channel_bit ( uint32_t channel_id)
private

Recomputes one channel's bit in the active mask from direct and counted usage.

Definition at line 152 of file Node.cpp.

153{
154 auto channel_bit = static_cast<uint32_t>((0x0ffffffff) & (1ULL << (uint64_t)channel_id));
155
156 bool used = (m_direct_channels_mask.load(std::memory_order_acquire) & channel_bit) != 0
157 || m_channel_usage_counts[channel_id].load(std::memory_order_acquire) > 0;
158
159 if (used) {
160 m_active_channels_mask.fetch_or(channel_bit, std::memory_order_acq_rel);
161 } else {
162 m_active_channels_mask.fetch_and(~channel_bit, std::memory_order_acq_rel);
163 m_pending_reset_mask.fetch_and(~channel_bit, std::memory_order_acq_rel);
164 }
165}
std::atomic< uint32_t > m_active_channels_mask
Bitmask tracking which channels are currently using this node.
Definition Node.hpp:787
std::atomic< uint32_t > m_pending_reset_mask
Bitmask tracking which channels have requested a reset.
Definition Node.hpp:811
std::atomic< uint32_t > m_direct_channels_mask
Channels registered directly through register_channel_usage.
Definition Node.hpp:792
std::array< std::atomic< uint32_t >, 32 > m_channel_usage_counts
Per channel count of consumer paths held through add_channel_usage.
Definition Node.hpp:797

References m_active_channels_mask, m_channel_usage_counts, m_direct_channels_mask, and m_pending_reset_mask.

Referenced by add_channel_usage(), register_channel_usage(), remove_channel_usage(), and unregister_channel_usage().

Here is the caller graph for this function: