AsyncReaderWriterResourceLock<TMoniker,TResource>.UpgradeableReadLockAsync Method

Definition

Overloads

UpgradeableReadLockAsync(CancellationToken)

Obtains an upgradeable read lock, asynchronously awaiting for the lock if it is not immediately available.

UpgradeableReadLockAsync(AsyncReaderWriterResourceLock<TMoniker,TResource>.LockFlags, CancellationToken)

Obtains a read lock, asynchronously awaiting for the lock if it is not immediately available.

UpgradeableReadLockAsync(CancellationToken)

Obtains an upgradeable read lock, asynchronously awaiting for the lock if it is not immediately available.

C#
public Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<TMoniker,TResource>.ResourceAwaitable UpgradeableReadLockAsync(System.Threading.CancellationToken cancellationToken = default);

Parameters

cancellationToken
CancellationToken

A token whose cancellation indicates lost interest in obtaining the lock. A canceled token does not release a lock that has already been issued. But if the lock isn't immediately available, a canceled token will cause the code that is waiting for the lock to resume with an OperationCanceledException.

Returns

An awaitable object whose result is the lock releaser.

Applies to

Visual Studio SDK 2022 i druge verzije
Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022

UpgradeableReadLockAsync(AsyncReaderWriterResourceLock<TMoniker,TResource>.LockFlags, CancellationToken)

Obtains a read lock, asynchronously awaiting for the lock if it is not immediately available.

C#
public Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<TMoniker,TResource>.ResourceAwaitable UpgradeableReadLockAsync(Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<TMoniker,TResource>.LockFlags options, System.Threading.CancellationToken cancellationToken = default);

Parameters

options
AsyncReaderWriterResourceLock<TMoniker,TResource>.LockFlags

Modifications to normal lock behavior.

cancellationToken
CancellationToken

A token whose cancellation indicates lost interest in obtaining the lock. A canceled token does not release a lock that has already been issued. But if the lock isn't immediately available, a canceled token will cause the code that is waiting for the lock to resume with an OperationCanceledException.

Returns

An awaitable object whose result is the lock releaser.

Applies to

Visual Studio SDK 2022 i druge verzije
Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022