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

◆ ServerThread() [2/4]

Lila::ServerThread::ServerThread ( Callback  callback)
inlineexplicit

Definition at line 146 of file ServerThread.hpp.

147 : m_stop_flag(std::make_shared<std::atomic<bool>>(false))
148 {
149 // Capture stop_flag by value (shared_ptr) to ensure it outlives the thread
150 // critical: the thread lambda must hold a reference to keep the flag alive
151 auto stop_flag = m_stop_flag;
152
153 m_thread = std::thread([callback = std::move(callback), stop_flag]() {
154 StopToken token(stop_flag.get());
155 callback(token);
156 });
157 }
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
std::shared_ptr< std::atomic< bool > > m_stop_flag

References m_stop_flag, m_thread, and token.