fix(ui): reentrancy guard on Health/AlarmSummary poll timers (arch-review S3)

Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
Joseph Doherty
2026-07-10 05:01:27 -04:00
parent bd6c310825
commit adc488a9f9
4 changed files with 50 additions and 4 deletions
@@ -0,0 +1,11 @@
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
/// <summary>Reentrancy guard for poll timers: a fixed-period Timer whose refresh outlives
/// the period stacks overlapping fan-outs against an already-degraded site (arch-review S3).
/// Callers TryEnter at tick start and skip the tick when the previous refresh is in flight.</summary>
public sealed class PollGate
{
private int _inFlight;
public bool TryEnter() => Interlocked.CompareExchange(ref _inFlight, 1, 0) == 0;
public void Exit() => Volatile.Write(ref _inFlight, 0);
}