AsyncReaderWriterLock.OnBeforeWriteLockReleased(Func<Task>) 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.
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
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.