renamed variable to workONqueue

This commit is contained in:
glax 2024-02-11 22:11:35 +01:00
parent 8a640491cb
commit 194e54fd9a

View File

@ -13,7 +13,7 @@ public abstract class Api : IDisposable
protected ILogger? Logger;
public readonly DeviceApi ApiType;
private readonly Queue<ValueTuple<ControlAction, Shocker, int, int>> _queue = new();
private bool _workQueue = true;
private bool _workOnQueue = true;
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
private readonly Thread _workQueueThread;
private const short CommandDelay = 50;
@ -48,7 +48,7 @@ public abstract class Api : IDisposable
private void QueueThread()
{
while (_workQueue)
while (_workOnQueue)
if (_queue.Count > 0 && _queue.Dequeue() is { } action)
{
this.Logger?.Log(LogLevel.Information, $"{action.Item1} {action.Item2} {action.Item3} {action.Item4}");
@ -86,6 +86,6 @@ public abstract class Api : IDisposable
public void Dispose()
{
_workQueue = false;
_workOnQueue = false;
}
}