AsyncReaderWriterResourceLock<TMoniker,TResource>.WriteLockAsync Method      
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| WriteLockAsync(CancellationToken) | Obtains a write lock, asynchronously awaiting for the lock if it is not immediately available. | 
| WriteLockAsync(AsyncReaderWriterResourceLock<TMoniker,TResource>.LockFlags, CancellationToken) | Obtains a write lock, asynchronously awaiting for the lock if it is not immediately available. | 
WriteLockAsync(CancellationToken)
Obtains a write lock, asynchronously awaiting for the lock if it is not immediately available.
public Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<TMoniker,TResource>.ResourceAwaitable WriteLockAsync(System.Threading.CancellationToken cancellationToken = default);override this.WriteLockAsync : System.Threading.CancellationToken -> Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<'Moniker, 'Resource (requires 'Resource : null)>.ResourceAwaitablePublic Function WriteLockAsync (Optional cancellationToken As CancellationToken = Nothing) As AsyncReaderWriterResourceLock(Of TMoniker, TResource).ResourceAwaitableParameters
- 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
WriteLockAsync(AsyncReaderWriterResourceLock<TMoniker,TResource>.LockFlags, CancellationToken)
Obtains a write lock, asynchronously awaiting for the lock if it is not immediately available.
public Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<TMoniker,TResource>.ResourceAwaitable WriteLockAsync(Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<TMoniker,TResource>.LockFlags options, System.Threading.CancellationToken cancellationToken = default);override this.WriteLockAsync : Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<'Moniker, 'Resource (requires 'Resource : null)>.LockFlags * System.Threading.CancellationToken -> Microsoft.VisualStudio.Threading.AsyncReaderWriterResourceLock<'Moniker, 'Resource (requires 'Resource : null)>.ResourceAwaitablePublic Function WriteLockAsync (options As AsyncReaderWriterResourceLock(Of TMoniker, TResource).LockFlags, Optional cancellationToken As CancellationToken = Nothing) As AsyncReaderWriterResourceLock(Of TMoniker, TResource).ResourceAwaitableParameters
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.