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

◆ start_conditional_thread()

void MayaFlux::Vruta::TaskScheduler::start_conditional_thread ( )
private

Start the conditional task processing thread if not already running.

This method ensures that the thread responsible for processing conditional tasks is started when the first conditional task is added. It checks if the thread is already running to avoid starting multiple threads.

Definition at line 443 of file Scheduler.cpp.

444{
445 if (m_conditional_thread.joinable())
446 return;
447
448#if MAYAFLUX_USE_JTHREAD
449 m_conditional_thread = std::jthread([this](const std::stop_token& st) {
450 while (!st.stop_requested())
452 });
453#else
454 m_conditional_stop.store(false, std::memory_order_release);
455 m_conditional_thread = std::thread([this]() {
456 while (!m_conditional_stop.load(std::memory_order_acquire))
458 });
459#endif
460}
void pump_conditional()
Pump the conditional task list in a separate thread.
std::atomic< bool > m_conditional_stop

References m_conditional_stop, m_conditional_thread, and pump_conditional().

Referenced by add_task().

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