private void PlayDispatcherRun(FancyThread t) { // No exception handling here on purpose // No try catch blocks should go in this method. while (running) { PlayDispatcherAction a; while (this.actions.TryDequeue(out a)) { t.CheckIn(); a.Invoke(); t.CheckIn(); } Thread.Sleep(1); t.CheckIn(); } }
internal PlayDispatcher() { this.actions = new System.Collections.Concurrent.ConcurrentQueue <PlayDispatcherAction>(); thread = new FancyThread("PlayDispatcher", PlayDispatcherRun); thread.Start(); }