private void IssueCommand(FocusLostAudio.Command command) { object obj = this.commandQueue; lock (obj) { this.commandQueue.Add(command); Monitor.Pulse(this.commandQueue); } }
private void WorkerThreadRun() { object obj = this.commandQueue; lock (obj) { bool flag = false; while (!flag) { if (this.commandQueue.Count == 0) { Monitor.Wait(this.commandQueue); } if (this.commandQueue.Count > 0) { FocusLostAudio.Command command = this.commandQueue[0]; if (command != FocusLostAudio.Command.EnableSnapshot) { if (command != FocusLostAudio.Command.DisableSnapshot) { if (command == FocusLostAudio.Command.Shutdown) { this.DisableSnapshot(); flag = true; } } else { this.DisableSnapshot(); } } else { this.EnableSnapshot(); } this.commandQueue.RemoveAt(0); } } } }