RandomUtil
using System;
using System.Runtime.CompilerServices;
using System.Threading;
namespace Polly.Utils
{
internal static class RandomUtil
{
[System.Runtime.CompilerServices.Nullable(1)]
private static readonly ThreadLocal<Random> Instance = new ThreadLocal<Random>(() => new Random());
public static double NextDouble()
{
return Instance.Value.NextDouble();
}
public static int Next(int maxValue)
{
return Instance.Value.Next(maxValue);
}
}
}