Exemplo n.º 1
0
        public void Haircut(Barber barber)
        {
            Console.WriteLine("Fryzjer " + barber.name + " rozpoczyna strzyzenie klienta " + this.name);
             //haircut = new Thread(new ThreadStart(barber.RunThread));
            //haircut = new Thread(() => barber.RunThread());

            //haircut.Start();

            Random rand = new Random();
            int time = rand.Next(1000, 3001);
            Console.WriteLine("Strzyzenie bedzie trwac " + time / 100 + " minut");
            haircut_in_progress = true;
            Thread.Sleep(time);
            Console.WriteLine("Fryzjer " + this.name + " koniec strzyżenia.");
            haircut_done = true;
        }
Exemplo n.º 2
0
        public void Haircut(Barber barber)
        {
            Console.WriteLine("Fryzjer " + barber.name + " rozpoczyna strzyzenie klienta " + this.name);
            //haircut = new Thread(new ThreadStart(barber.RunThread));
            //haircut = new Thread(() => barber.RunThread());

            //haircut.Start();

            Random rand = new Random();
            int    time = rand.Next(1000, 3001);

            Console.WriteLine("Strzyzenie bedzie trwac " + time / 100 + " minut");
            haircut_in_progress = true;
            Thread.Sleep(time);
            Console.WriteLine("Fryzjer " + this.name + " koniec strzyżenia.");
            haircut_done = true;
        }