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

◆ initialize_state()

bool MayaFlux::Vruta::CrossRoutine::initialize_state ( uint64_t  current_context = 0U)
overridevirtual

Initializes the coroutine's state for execution.

Parameters
current_sampleCurrent sample position in the timeline
Returns
True if initialization succeeded, false otherwise

Prepares the coroutine for execution by setting its initial sample position and other state. This should be called before the first attempt to resume the coroutine.

Implements MayaFlux::Vruta::Routine.

Definition at line 436 of file Routine.cpp.

437{
438 if (!m_handle || !m_handle.address() || m_handle.done()) {
439 return false;
440 }
441
442 m_handle.promise().next_sample.store(current_context, std::memory_order_release);
443 m_handle.promise().next_frame.store(current_context, std::memory_order_release);
444 m_handle.resume();
445 return true;
446}
std::coroutine_handle< promise_type > m_handle
Definition Routine.hpp:726

References m_handle.

Referenced by try_resume_with_context().

+ Here is the caller graph for this function: