internal static void AddUser() { OpenAL.Debug("Adding OpenAL user"); int now = Interlocked.Increment(ref counter); if (now != 1 || running) { return; } lock (SyncRoot) { if (running) { return; } running = true; (runnerThread = new Thread(Runner) { IsBackground = true, Name = "OpenAL Runner" }).Start(); } }
internal static void AddPlaybackProvider(OpenALPlaybackProvider provider) { OpenAL.Debug("Adding OpenAL Playback Provider"); if (provider == null) { throw new ArgumentNullException("provider"); } lock (PlaybackProviders) PlaybackProviders.Add(provider); }
internal static void RemoveCaptureProvider(OpenALCaptureProvider provider) { OpenAL.Debug("Removing OpenAL Capture Provider"); if (provider == null) { throw new ArgumentNullException("provider"); } lock (CaptureProviders) CaptureProviders.Remove(provider); }
internal static void RemoveUser() { OpenAL.Debug("Removing OpenAL user"); int now = Interlocked.Decrement(ref counter); if (now != 0 || !running) { return; } lock (SyncRoot) { if (!running) { return; } running = false; } }