示例#1
0
文件: Num.cs 项目: BENICHN/BenLib
        public static async Task <int> RandomIntAsync()
        {
            try
            {
                await RandomSemaphore.WaitAsync();

                return(RandomObject.Next());
            }
            finally { RandomSemaphore.Release(); }
        }
示例#2
0
文件: Num.cs 项目: BENICHN/BenLib
        public static async Task <int> RandomIntAsync(int minValue, int maxValue)
        {
            try
            {
                await RandomSemaphore.WaitAsync();

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