Class OnceGuard
Lets a piece of work happen exactly once, with no key to distinguish call sites — the single-latch form of OnceGuard<TKey>.
Inherited Members
Namespace: Serenity.Shared.Utils
Assembly: Serenity.Shared.dll
Syntax
public sealed class OnceGuard
Constructors
OnceGuard()
Declaration
public OnceGuard()
Properties
HasEntered
Whether the guarded work has already happened.
Declaration
public bool HasEntered { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Reset()
Unlatches, so the guarded work can happen once more.
Declaration
public void Reset()
TryEnter()
Reports whether this is the first call, and latches.
Declaration
public bool TryEnter()
Returns
| Type | Description |
|---|---|
| bool | True on the first call; false on every later one. |