Exemple #1
0
        public void RightHandedEaterGetsFood(Philosopher eater, TakeBitEventArgs e)
        {
            eater.RightChopstick.WaitOne();
            eater.LeftChopstick.WaitOne();

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

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

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



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