Ejemplo n.º 1
0
        public void RightHandedEaterGetsFood(Philosopher eater, TakeBitEventArgs e)
        {
            eater.RightChopstick.WaitOne();
            eater.LeftChopstick.WaitOne();

            Eat(eater);
            eater.RightChopstick.Set();
            eater.LeftChopstick.Set();
        }
Ejemplo n.º 2
0
        public void RightHandedEaterGetsFood(Philosopher eater, TakeBitEventArgs e)
        {

            eater.RightChopstick.WaitOne();
            eater.LeftChopstick.WaitOne();

            Eat(eater);
            eater.RightChopstick.Set();
            eater.LeftChopstick.Set();



        }
Ejemplo n.º 3
0
 protected virtual void OnTakeBiteEvent(Philosopher eater, TakeBitEventArgs e)
 {
     TakeBiteEvent?.Invoke(eater, e);
 }
Ejemplo n.º 4
0
 public void Eat(TakeBitEventArgs e)
 {
     IsEating = true;
     EatFromTable?.Invoke(this, e);
 }
Ejemplo n.º 5
0
 protected virtual void OnTakeBiteEvent(Philosopher eater, TakeBitEventArgs e)
 {
     TakeBiteEvent?.Invoke(eater, e);
 }
Ejemplo n.º 6
0
 public void Eat(TakeBitEventArgs e)
 {
     IsEating = true;
     EatFromTable?.Invoke(this, e);
 }