SynchronizationContext Class
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.
Provides the basic functionality for propagating a synchronization context in various synchronization models.
public ref class SynchronizationContext
public class SynchronizationContext
type SynchronizationContext = class
Public Class SynchronizationContext
- Inheritance
-
SynchronizationContext
- Derived
The SynchronizationContext class is a base class that provides a free-threaded context with no synchronization.
The purpose of the synchronization model implemented by this class is to allow the internal asynchronous/synchronous operations of the common language runtime to behave properly with different synchronization models. This model also simplifies some of the requirements that managed applications have had to follow in order to work correctly under different synchronization environments.
Providers of synchronization models can extend this class and provide their own implementations for these methods.
For more information about synchronization contexts, see the article It's All About the SynchronizationContext in the MSDN Magazine.
Synchronization |
Creates a new instance of the SynchronizationContext class. |
Current |
Gets the synchronization context for the current thread. |
Create |
When overridden in a derived class, creates a copy of the synchronization context. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Is |
Determines if wait notification is required. |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Operation |
When overridden in a derived class, responds to the notification that an operation has completed. |
Operation |
When overridden in a derived class, responds to the notification that an operation has started. |
Post(Send |
When overridden in a derived class, dispatches an asynchronous message to a synchronization context. |
Send(Send |
When overridden in a derived class, dispatches a synchronous message to a synchronization context. |
Set |
Sets the current synchronization context. |
Set |
Sets notification that wait notification is required and prepares the callback method so it can be called more reliably when a wait occurs. |
To |
Returns a string that represents the current object. (Inherited from Object) |
Wait(Int |
Waits for any or all the elements in the specified array to receive a signal. |
Wait |
Helper function that waits for any or all the elements in the specified array to receive a signal. |
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: