Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Pote       pote       = new Pote(5);
            Cozinheiro cozinheiro = new Cozinheiro(pote);

            List <Thread> s = new List <Thread>();

            Thread c = new Thread(cozinheiro.execute);

            c.Start();

            for (int i = 0; i < 15; i++)
            {
                s.Add(new Thread(new Selvagem(pote, i).execute));
                s[i].Start();
            }
        }
Ejemplo n.º 2
0
 public Cozinheiro(Pote pote)
 {
     this.pote = pote;
 }
Ejemplo n.º 3
0
 public Selvagem(Pote pote, int name)
 {
     this.pote = pote;
     this.name = name;
 }