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

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

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

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



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