Ejemplo n.º 1
0
        /// <summary>
        /// Acquires a WRITE lock asynchronously. Not compatible with another WRITE lock or a UPGRADE lock
        /// </summary>
        public Task <IDisposable> AcquireWriteLockAsync(TimeSpan?timeout = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var handleTask = this.TryAcquireWriteLockAsync(timeout ?? Timeout.InfiniteTimeSpan, cancellationToken);

            return(DistributedLockHelpers.ValidateTryAcquireResultAsync(handleTask, timeout));
        }