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

◆ mark_stream_open()

static void MayaFlux::Core::RtAudioSingleton::mark_stream_open ( )
inlinestatic

Registers an active audio stream in the system.

Exceptions
std::runtime_errorif a stream is already open

Thread-safe method that enforces the constraint of having only one active audio stream at any time. This prevents resource conflicts that could lead to audio glitches or system instability.

Definition at line 69 of file RtAudioSingleton.hpp.

70 {
71 std::lock_guard<std::mutex> lock(s_mutex);
72 if (s_stream_open) {
73 throw std::runtime_error("Error: Attempted to open a second RtAudio stream when one is already open");
74 }
75 s_stream_open = true;
76 }
static bool s_stream_open
Stream state flag to enforce exclusive stream ownership.
static std::mutex s_mutex
Synchronization primitive for thread-safe access to the singleton.

References s_mutex, and s_stream_open.

Referenced by MayaFlux::Core::RtAudioStream::open().

+ Here is the caller graph for this function: