Exemplo n.º 1
0
 public static int RandomInt()
 {
     try
     {
         RandomSemaphore.Wait();
         return(RandomObject.Next());
     }
     finally { RandomSemaphore.Release(); }
 }
Exemplo n.º 2
0
 public static int RandomInt(int minValue, int maxValue)
 {
     try
     {
         RandomSemaphore.Wait();
         return(RandomObject.Next(minValue, maxValue));
     }
     finally { RandomSemaphore.Release(); }
 }
Exemplo n.º 3
0
 public static double Random()
 {
     try
     {
         RandomSemaphore.Wait();
         return(RandomObject.NextDouble());
     }
     finally { RandomSemaphore.Release(); }
 }