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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user