Exemplo n.º 1
0
        public static async Task <int> RandomIntAsync()
        {
            try
            {
                await RandomSemaphore.WaitAsync();

                return(RandomObject.Next());
            }
            finally { RandomSemaphore.Release(); }
        }
Exemplo n.º 2
0
        public static async Task <int> RandomIntAsync(int minValue, int maxValue)
        {
            try
            {
                await RandomSemaphore.WaitAsync();

                return(RandomObject.Next(minValue, maxValue));
            }
            finally { RandomSemaphore.Release(); }
        }