The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SynchronizationContext Class


Provides the basic functionality for propagating a synchronization context in various synchronization models.

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)

	Flags = SecurityPermissionFlag.NoFlags | SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy)]
public class SynchronizationContext


Creates a new instance of the SynchronizationContext class.


Gets the synchronization context for the current thread.


When overridden in a derived class, creates a copy of the synchronization context.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Determines if wait notification is required.


Creates a shallow copy of the current Object.(Inherited from Object.)


When overridden in a derived class, responds to the notification that an operation has completed.


When overridden in a derived class, responds to the notification that an operation has started.

System_CAPS_pubmethodPost(SendOrPostCallback, Object)

When overridden in a derived class, dispatches an asynchronous message to a synchronization context.

System_CAPS_pubmethodSend(SendOrPostCallback, Object)

When overridden in a derived class, dispatches a synchronous message to a synchronization context.


Sets the current synchronization context.


Sets notification that wait notification is required and prepares the callback method so it can be called more reliably when a wait occurs.


Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodWait(IntPtr[], Boolean, Int32)

Waits for any or all the elements in the specified array to receive a signal.

System_CAPS_protmethodSystem_CAPS_staticWaitHelper(IntPtr[], Boolean, Int32)

Helper function that waits for any or all the elements in the specified array to receive a signal.

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.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
© 2015 Microsoft