public void Dispose() { if (this.mutex != null) { this.mutex.Exit(); this.mutex = null; } }
public static UseLockScope UseLock(this CriticalSection mutex) => new UseLockScope(mutex);
internal UseLockScope(CriticalSection mutex) { Validate.IsNotNull <CriticalSection>(mutex, "mutex"); this.mutex = mutex; this.mutex.Enter(); }