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

◆ try_resume_with_context()

bool MayaFlux::Vruta::FreeRoutine::try_resume_with_context ( uint64_t  current_value,
DelayContext   
)
overridevirtual

Attempts to resume the coroutine with explicit temporal context.

Parameters
current_valueCurrent position in the timeline (samples, frames, cycles, etc.)
contextThe temporal context being processed
Returns
True if the coroutine was resumed, false otherwise

This context-aware resume method allows different temporal mechanisms to coexist within the same processing token. For example, both sample-based and buffer-cycle-based delays can use SAMPLE_ACCURATE token without interfering with each other.

The default implementation delegates to try_resume(uint64_t) for backward compatibility. Derived classes can override to implement context-specific resumption logic.

Reimplemented from MayaFlux::Vruta::Routine.

Definition at line 643 of file Routine.cpp.

644{
645 if (!is_active())
646 return false;
647
648 auto& p = m_handle.promise();
649
650 if (p.should_terminate || !p.auto_resume)
651 return false;
652
653 if (!p.armed.load(std::memory_order_acquire))
654 return false;
655
656 if (!p.condition || !p.condition())
657 return false;
658
659 p.armed.store(false, std::memory_order_release);
660 p.condition = nullptr;
661 m_handle.resume();
662 return true;
663}
std::coroutine_handle< promise_type > m_handle
Definition Routine.hpp:843
bool is_active() const override
Checks if the coroutine is still active.
Definition Routine.cpp:624

References is_active(), and m_handle.

Referenced by try_resume().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: