C# (CSharp) Watchdog.Validation.Core.Util 네임스페이스

클래스들

이름 설명
ReentrancyGuard A utility class which helps guard against reentrancy. This is safer and cleaner alternative to the typical pattern of adding a bool flag to a class, and setting it to true when you wish to guard, then resetting it back to false. The ReentrancyGuard returns an IDisposable token when call its Set method. From this point on, its IsSet property will be true. When you wish to exit out of the safe block, call Dispose on the token. The best usage is within a using block: // class member: private readonly ReentrancyGuard guard; // to protect a block from reentrancy: using (this.guard.Set()) { ... safe code } And wherever you need to guard: if (this.guard.IsSet) { return; } This class is meant to be used only a single thread.
ReentrancyGuard.ExitToken A single token created to delineate a guarded scope. When created, it sets the locked flag to of the given guard to true. When disposed it sets the flag back to false.
RunAfterDispatchCommand