Esempio n. 1
0
 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();
     }
 }
Esempio n. 2
0
 internal PlayDispatcher()
 {
     this.actions = new System.Collections.Concurrent.ConcurrentQueue <PlayDispatcherAction>();
     thread       = new FancyThread("PlayDispatcher", PlayDispatcherRun);
     thread.Start();
 }