MayaFlux 0.4.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 630 of file Routine.cpp.

631{
632 if (!is_active())
633 return false;
634
635 auto& p = m_handle.promise();
636
637 if (p.should_terminate || !p.auto_resume)
638 return false;
639
640 if (!p.armed.load(std::memory_order_acquire))
641 return false;
642
643 if (!p.condition || !p.condition())
644 return false;
645
646 p.armed.store(false, std::memory_order_release);
647 p.condition = nullptr;
648 m_handle.resume();
649 return true;
650}
std::coroutine_handle< promise_type > m_handle
Definition Routine.hpp:811
bool is_active() const override
Checks if the coroutine is still active.
Definition Routine.cpp:611

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: