/// <summary> /// Acquires an UPGRADE lock synchronously, failing with <see cref="TimeoutException"/> if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: /// <code> /// using (myLock.AcquireUpgradeableReadLock(...)) /// { /// /* we have the lock! */ /// } /// // dispose releases the lock /// </code> /// </summary> /// <param name="timeout">How long to wait before giving up on the acquisition attempt. Defaults to <see cref="Timeout.InfiniteTimeSpan"/></param> /// <param name="cancellationToken">Specifies a token by which the wait can be canceled</param> /// <returns>A <see cref="SqlDistributedReaderWriterLockUpgradeableHandle"/> which can be used to release the lock</returns> public SqlDistributedReaderWriterLockUpgradeableHandle AcquireUpgradeableReadLock(TimeSpan?timeout = null, CancellationToken cancellationToken = default) => DistributedLockHelpers.AcquireUpgradeableReadLock(this, timeout, cancellationToken);