Microsoft.VisualStudio.Threading Namespace
The Microsoft.VisualStudio.Threading namespace contains APIs for use in Visual Studio SDK projects. You should use these APIs for asynchronous programming in Visual Studio. Doing so helps you avoid deadlocks
This library is based on the .NET Framework Task Parallel Library (TPL). For information about this library, see Task Parallel Library (TPL).
Classes
Class | Description | |
---|---|---|
AsyncAutoResetEvent | An asynchronous implementation of an AutoResetEvent. | |
AsyncBarrier | An asynchronous barrier that blocks the signaler until all the other participants have signaled. | |
AsyncCountdownEvent | An asynchronous countdown event. | |
AsyncLazy<T> | A thread-safe, lazily and asynchronously evaluated value factory. | |
AsyncLocal<T> | Stores reference types in the CallContext so that they can be marshaled safely. | |
AsyncManualResetEvent | A flavor of ManualResetEvent that can be asynchronously awaited. | |
AsyncQueue<T> | A thread-safe, asynchronously dequeuable queue. | |
AsyncReaderWriterLock | Microsoft internal only. A non-blocking lock that allows concurrent access, exclusive access, or concurrent access that can be upgraded to exclusive access. | |
AsyncReaderWriterLock.Awaiter | Microsoft internal only. Manages asynchronous access to a lock.. | |
AsyncReaderWriterResourceLock<TMoniker, TResource> | Microsoft internal only. A non-blocking lock that allows concurrent access, exclusive access, or concurrent with upgradeability to exclusive access, making special allowances for resources that must be prepared for concurrent or exclusive access. | |
AsyncSemaphore | An asynchronous class like SemaphoreSlim with more convenient release syntax. | |
AwaitExtensions | Extension methods and awaitables for .NET. | |
DelegatingJoinableTaskFactory | A JoinableTaskFactory base class for derived types that delegate some of their work to an existing instance. | |
HangReportContribution | A contribution to an aggregate hang report. | |
JoinableTask | Tracks asynchronous operations and allows you to join asynchronous operations to avoid deadlocks while synchronously blocking the Main thread until the completion of the operation. | |
JoinableTask<T> | Tracks asynchronous operations and allows you to Join asynchronous operations. This is to avoid deadlocks while synchronously blocking the Main thread until the completion of the operation. | |
JoinableTaskCollection | A joinable collection of jobs. | |
JoinableTaskContext | A common context within which joinable tasks may be created and interact to avoid deadlocks. | |
JoinableTaskContextNode | A customizable source of JoinableTaskFactory instances. | |
JoinableTaskFactory | A factory for starting asynchronous tasks that can mitigate deadlocks when the tasks require the Main thread of an application and the Main thread may itself be blocking on the completion of a task. | |
NoMessagePumpSyncContext | A SynchronizationContext whose synchronously-blocking Wait method does not allow any re-entrancy via the message pump. | |
ProgressWithCompletion<T> | An incremental progress reporting mechanism that also allows asynchronous awaiting for all reports to be processed. | |
ThreadingTools | Utility methods for working across threads. | |
TplExtensions | Extensions to the Task Parallel Library. |
Structures
Structure | Description | |
---|---|---|
AsyncReaderWriterLock.Awaitable | Microsoft internal only. An awaitable that is returned from asynchronous lock requests. | |
AsyncReaderWriterLock.LockHandle | Microsoft internal only. A "public" representation of a specific lock. | |
AsyncReaderWriterLock.Releaser | Microsoft internal only. A value whose disposal releases a held lock. | |
AsyncReaderWriterLock.Suppression | Microsoft internal only. A value whose disposal restores visibility of any locks held by the caller. | |
AsyncReaderWriterResourceLock<TMoniker, TResource>.ResourceAwaitable | Microsoft internal only. An awaitable that is returned from asynchronous lock requests. | |
AsyncReaderWriterResourceLock<TMoniker, TResource>.ResourceAwaiter | Microsoft internal only. Manages asynchronous access to a lock. | |
AsyncReaderWriterResourceLock<TMoniker, TResource>.ResourceReleaser | Microsoft internal only. A value whose disposal releases a held lock. | |
AsyncSemaphore.Releaser | A value whose disposal triggers the release of a lock. | |
AwaitExtensions.TaskSchedulerAwaitable | An awaitable that executes continuations on the specified task scheduler. | |
AwaitExtensions.TaskSchedulerAwaiter | An awaiter returned from GetAwaiter. | |
JoinableTaskCollection.JoinRelease | A value whose disposal cancels a Join operation. | |
JoinableTaskContext.RevertRelevance | A structure that clears the CallContext and SynchronizationContext async/thread values and restores those values when this structure is disposed. | |
JoinableTaskFactory.MainThreadAwaitable | An awaitable struct that facilitates an asynchronous transition to the Main thread. | |
JoinableTaskFactory.MainThreadAwaiter | An awaiter struct that facilitates an asynchronous transition to the main thread. | |
SpecializedSyncContext | A structure that applies and reverts changes to the SynchronizationContext. | |
TplExtensions.NoThrowTaskAwaitable | An awaitable that wraps a task and never throws an exception when waited on. | |
TplExtensions.NoThrowTaskAwaiter | An awaiter that wraps a task and never throws an exception when waited on. |
Interfaces
Interface | Description | |
---|---|---|
IAsyncDisposable | Defines an asynchronous method to release allocated resources. | |
IHangReportContributor | Provides a facility to produce reports that may be useful when analyzing hangs. |
Delegates
Delegate | Description | |
---|---|---|
AsyncEventHandler | An asynchronous event handler. | |
AsyncEventHandler<T> | An asynchronous event handler. |
Enumerations
Enumeration | Description | |
---|---|---|
AsyncReaderWriterLock.LockFlags | Microsoft internal only. Flags that modify the default lock behavior. | |
AsyncReaderWriterResourceLock<TMoniker, TResource>.LockFlags | Microsoft internal only. Flags that modify the default lock behavior. |