Exemplo n.º 1
0
 private RwVaultInternalLockedResource([NotNull] ReadWriteVault <T> owner)
 {
     _releaseFlag          = default;
     _owner                = owner ?? throw new ArgumentNullException(nameof(owner));
     _upgradeAction        = null;
     _upgradeForeverAction = null;
     _b      = null;
     _isGood = false;
     _mode   = AcquisitionMode.ReadOnly;
     Debug.Assert((_upgradeAction == null) == (_upgradeForeverAction == null),
                  "Both ok, neither ok.  Exactly one not ok.");
 }
Exemplo n.º 2
0
 private RwVaultInternalLockedResource([NotNull] ReadWriteVault <T> owner, [NotNull] Box b, [CanBeNull] Action <TimeSpan?, CancellationToken> upgradeAction, [CanBeNull] Action upgradeForeverAction, AcquisitionMode mode)
 {
     _mode                 = mode.ValueOrThrowIfNDef();
     _b                    = b ?? throw new ArgumentNullException(nameof(b));
     _upgradeAction        = upgradeAction;
     _upgradeForeverAction = upgradeForeverAction;
     _owner                = owner ?? throw new ArgumentNullException(nameof(owner));
     _releaseFlag          = default;
     _isGood               = true;
     Debug.Assert((_upgradeAction == null) == (_upgradeForeverAction == null),
                  "Both ok, neither ok.  Exactly one not ok.");
 }