Exemple #1
0
        public void Finish()
        {
            while (buffer.IsRunning())
            {
                Thread.Sleep(1000);
            }

            Console.WriteLine("Are you Happy now?");
            Console.WriteLine("Buffer is running{0}: ", buffer.IsRunning());
            Console.ReadKey();
        }
Exemple #2
0
 public void Read()
 {
     while (board.IsRunning())
     {
         readerMutex.WaitOne();
         FlightInfo flight = board.GetFlight();
         readerMutex.ReleaseMutex();
         Thread.Sleep(200);
     }
 }
Exemple #3
0
        public void Write()
        {
            while (board.IsRunning())
            {
                writerMutex.WaitOne();
                List <FlightInfo> flights = new List <FlightInfo>();
                flights = FlightGenerator.GenerateFlights(4, rand);

                for (int i = 0; i < flights.Count; i++)
                {
                    board.AddFlight(flights[i]);
                }

                writerMutex.ReleaseMutex();
                Thread.Sleep(300);
            }
        }