MayaFlux 0.5.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 110 of file Node.cpp.

111{
112 uint64_t expected = 0;
113 return m_snapshot_context_id.compare_exchange_strong(
114 expected, context_id,
115 std::memory_order_acq_rel,
116 std::memory_order_acquire);
117}
std::atomic< uint64_t > m_snapshot_context_id
Unique identifier for the current snapshot context.
Definition Node.hpp:752

References m_snapshot_context_id.