internal static void Start(object obj) { _queue = new ConcurrentWorkQueue <Action>(action => action()); SoundService.Init(); XAudioDLL = Kernel32.LoadLibraryEx("XAudio2_7.DLL", IntPtr.Zero, (LoadLibraryFlags)0x00000800); _resetter.Set(); //var _stopwatch = Stopwatch.StartNew(); while (!CancelTokenSource.IsCancellationRequested) { if (!SoundService.Update()) { if (SoundService.IsCriticalError) { SoundService.Reset(); } } _queue.Work(); //_stopwatch.Restart(); } }