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

◆ try_claim_snapshot_context()

bool MayaFlux::Nodes::Node::try_claim_snapshot_context ( uint64_t  context_id)

Attempt to claim snapshot context for this processing cycle.

Parameters
context_idUnique context identifier for this buffer processing
Returns
true if this caller claimed the context (should call save_state)

This method enables multiple NodeBuffers referencing the same node to coordinate save/restore state operations. Only the first caller per processing context will claim the snapshot, preventing nested state saves.

Definition at line 96 of file Node.cpp.

97{
98 uint64_t expected = 0;
99 return m_snapshot_context_id.compare_exchange_strong(
100 expected, context_id,
101 std::memory_order_acq_rel,
102 std::memory_order_acquire);
103}
std::atomic< uint64_t > m_snapshot_context_id
Unique identifier for the current snapshot context.
Definition Node.hpp:610

References m_snapshot_context_id.