AsyncLazyInitializer(Func<Task>, JoinableTaskFactory) Constructor
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.
Initializes a new instance of the AsyncLazyInitializer class.
public AsyncLazyInitializer (Func<System.Threading.Tasks.Task> action, Microsoft.VisualStudio.Threading.JoinableTaskFactory? joinableTaskFactory = default);
new Microsoft.VisualStudio.Threading.AsyncLazyInitializer : Func<System.Threading.Tasks.Task> * Microsoft.VisualStudio.Threading.JoinableTaskFactory -> Microsoft.VisualStudio.Threading.AsyncLazyInitializer
Public Sub New (action As Func(Of Task), Optional joinableTaskFactory As JoinableTaskFactory = Nothing)
Parameters
- joinableTaskFactory
- JoinableTaskFactory
The factory to use when invoking the action
in InitializeAsync(CancellationToken) to avoid deadlocks when the main thread is required by the action
.