private InternalCustomRwLockedResource <TVault> UpgradeWaitForever()
 {
     if (_box == null)
     {
         throw new InvalidOperationException("This object is invalid.");
     }
     _upgradeForever();
     return(InternalCustomRwLockedResource <TVault> .CreateWritableLockedResource(_box, _vault));
 }
 private InternalCustomRwLockedResource <TVault> UpgradeAction(TimeSpan?ts, CancellationToken token)
 {
     if (_box == null)
     {
         throw new InvalidOperationException("This object is invalid.");
     }
     if (ts.HasValue && ts <= TimeSpan.Zero)
     {
         throw new ArgumentOutOfRangeException(nameof(ts), ts, @"Not null timespan must have positive value.");
     }
     _upgradeWithWait(ts, token);
     return(InternalCustomRwLockedResource <TVault> .CreateWritableLockedResource(_box, _vault));
 }
Esempio n. 3
0
            internal InternalCustomRwLockedResource <StringBuilderCustomVault> PerformRwLockBlockForever()
            {
                var ilr = ExecuteGetInternalLockedResourceBlockForever(AcquisitionMode.ReadWrite);

                try
                {
                    return(InternalCustomRwLockedResource <StringBuilderCustomVault> .CreateWritableLockedResource(
                               ref ilr, this));
                }
                finally
                {
                    ilr.Dispose();
                }
            }
Esempio n. 4
0
            internal InternalCustomRwLockedResource <StringBuilderCustomVault> PerformRwLock(TimeSpan?timeout,
                                                                                             CancellationToken token)
            {
                var ilr = ExecuteGetInternalLockedResource(timeout, token, AcquisitionMode.ReadWrite);

                try
                {
                    return(InternalCustomRwLockedResource <StringBuilderCustomVault> .CreateWritableLockedResource(
                               ref ilr, this));
                }
                finally
                {
                    ilr.Dispose();
                }
            }