Sdílet prostřednictvím


AsyncReaderWriterLock.OnBeforeWriteLockReleased(Func<Task>) Method

Definition

Registers a callback to be invoked when the write lock held by the caller is about to be ultimately released (outermost write lock).

public:
 void OnBeforeWriteLockReleased(Func<System::Threading::Tasks::Task ^> ^ action);
public void OnBeforeWriteLockReleased (Func<System.Threading.Tasks.Task> action);
member this.OnBeforeWriteLockReleased : Func<System.Threading.Tasks.Task> -> unit
Public Sub OnBeforeWriteLockReleased (action As Func(Of Task))

Parameters

action
Func<Task>

The asynchronous delegate to invoke. Access to the write lock is provided throughout the asynchronous invocation.

Remarks

This supports some scenarios VC++ has where change event handlers need to inspect changes, or follow up with other changes to respond to earlier changes, at the conclusion of the lock. This method is safe to call from within a previously registered callback, in which case the registered callback will run when previously registered callbacks have completed execution. If the write lock is released to an upgradeable read lock, these callbacks are fired synchronously with respect to the writer who is releasing the lock. Otherwise, the callbacks are invoked asynchronously with respect to the releasing thread.

Applies to