Addressed some warnings

This commit is contained in:
Thorsten Sommer 2024-05-29 11:37:29 +02:00
parent 817895015f
commit 8ade2f5a5d
No known key found for this signature in database
GPG Key ID: B0B7E2FC074BF1F5
2 changed files with 8 additions and 1 deletions

View File

@ -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>

View File

@ -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)