Example #1
0
 public static void Two()
 {
     lock (_locker)
     {
         if (_currentMethod == 1)
         {
             _currentMethod = 2;
             Speak.SayTwo();
         }
     }
 }
Example #2
0
 public static void Three()
 {
     lock (_locker)
     {
         if (_currentMethod == 2)
         {
             _currentMethod = 0;
             Speak.SayThree();
         }
     }
 }
Example #3
0
 public static void One()
 {
     lock (_locker)
     {
         if (_currentMethod == 0)
         {
             _currentMethod = 1;
             Speak.SayOne();
         }
     }
 }