Addressed some warnings
This commit is contained in:
parent
817895015f
commit
8ade2f5a5d
@ -4,6 +4,8 @@ using System.Numerics;
|
||||
using System.Threading;
|
||||
using System.Threading.Channels;
|
||||
|
||||
// ReSharper disable RedundantExtendsListEntry
|
||||
|
||||
namespace FastRng;
|
||||
|
||||
public sealed class MultiChannelRng<TNum> : IRandom<TNum>, IDisposable where TNum : IFloatingPointIeee754<TNum>, IAdditionOperators<TNum, TNum, TNum>
|
||||
|
@ -5,6 +5,8 @@ using System.Numerics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// ReSharper disable RedundantExtendsListEntry
|
||||
|
||||
namespace FastRng;
|
||||
|
||||
/// <summary>
|
||||
@ -37,7 +39,10 @@ public sealed class MultiThreadedRng<TNum> : IRandom<TNum>, IDisposable where TN
|
||||
private const int QUEUE_SIZE_INT = QUEUE_SIZE_FLOAT * 2;
|
||||
|
||||
private static readonly TNum CONST_FLOAT_CONVERSION = TNum.CreateChecked(2.328306435454494e-10f);
|
||||
|
||||
// ReSharper disable StaticMemberInGenericType
|
||||
private static readonly object LOCKER = new();
|
||||
// ReSharper restore StaticMemberInGenericType
|
||||
|
||||
// Gets used to stop the producer threads:
|
||||
private readonly CancellationTokenSource producerTokenSource = new();
|
||||
@ -197,7 +202,7 @@ public sealed class MultiThreadedRng<TNum> : IRandom<TNum>, IDisposable where TN
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
// A local source buffer of uints:
|
||||
uint[] bufferSource = null;
|
||||
uint[] bufferSource;
|
||||
|
||||
// Try to get the next source buffer:
|
||||
while (!this.queueIntegers.TryDequeue(out bufferSource) && !cancellationToken.IsCancellationRequested)
|
||||
|
Loading…
Reference in New Issue
Block a user