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

◆ request_shutdown()

void MayaFlux::Core::Engine::request_shutdown ( )

Request shutdown from any thread.

Signals the event loop to exit. Thread-safe. Call this to gracefully terminate await_shutdown().

Definition at line 215 of file Engine.cpp.

216{
217 m_should_shutdown.store(true, std::memory_order_release);
218
219#ifdef MAYAFLUX_PLATFORM_MACOS
220 CFRunLoopStop(CFRunLoopGetMain());
221#elif defined(MAYAFLUX_PLATFORM_WINDOWS)
222 PostThreadMessage(Parallel::g_MainThreadId, WM_QUIT, 0, 0);
223#endif
224}
std::atomic< bool > m_should_shutdown
Definition Engine.hpp:393

References m_should_shutdown.