Exemple #1
0
        public static void Main(string[] args)
        {
            BarberShop barberShop = new BarberShop("Alex");

            barberShop.GetCustomer();

            Console.ReadKey();
        }
 public Barber(string name, BarberShop barberShop)
 {
     this.name         = name;
     this.isSleeping   = true;
     this.barberShop   = barberShop;
     this.barberThread = new Thread(baberThreadAction);
     this.barberThread.Start();
 }
        static void Main(string[] args)
        {
            BarberShop bs = new BarberShop(2);

            bs.Arrive(new Costumer("C0"));
            Thread.Sleep(1200);
            bs.Arrive(new Costumer("C1"));
            Thread.Sleep(10000);
            bs.Arrive(new Costumer("C2"));
            Thread.Sleep(105);
            bs.Arrive(new Costumer("C3"));
            Thread.Sleep(1000);
            bs.Arrive(new Costumer("C4"));
            bs.Arrive(new Costumer("C5"));
        }