SynchronizationContext SynchronizationContext SynchronizationContext SynchronizationContext Class

Definition

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
SynchronizationContextSynchronizationContextSynchronizationContextSynchronizationContext
Derived

Remarks

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.

Constructors

SynchronizationContext() SynchronizationContext() SynchronizationContext() SynchronizationContext()

Creates a new instance of the SynchronizationContext class.

Properties

Current Current Current Current

Gets the synchronization context for the current thread.

Methods

CreateCopy() CreateCopy() CreateCopy() CreateCopy()

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsWaitNotificationRequired() IsWaitNotificationRequired() IsWaitNotificationRequired() IsWaitNotificationRequired()

Determines if wait notification is required.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OperationCompleted() OperationCompleted() OperationCompleted() OperationCompleted()

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

OperationStarted() OperationStarted() OperationStarted() OperationStarted()

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

Post(SendOrPostCallback, Object) Post(SendOrPostCallback, Object) Post(SendOrPostCallback, Object) Post(SendOrPostCallback, Object)

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

Send(SendOrPostCallback, Object) Send(SendOrPostCallback, Object) Send(SendOrPostCallback, Object) Send(SendOrPostCallback, Object)

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

SetSynchronizationContext(SynchronizationContext) SetSynchronizationContext(SynchronizationContext) SetSynchronizationContext(SynchronizationContext) SetSynchronizationContext(SynchronizationContext)

Sets the current synchronization context.

SetThreadStaticContext(SynchronizationContext) SetThreadStaticContext(SynchronizationContext) SetThreadStaticContext(SynchronizationContext) SetThreadStaticContext(SynchronizationContext)
SetWaitNotificationRequired() SetWaitNotificationRequired() SetWaitNotificationRequired() SetWaitNotificationRequired()

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

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
Wait(IntPtr[], Boolean, Int32) Wait(IntPtr[], Boolean, Int32) Wait(IntPtr[], Boolean, Int32) Wait(IntPtr[], Boolean, Int32)

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

WaitHelper(IntPtr[], Boolean, Int32) WaitHelper(IntPtr[], Boolean, Int32) WaitHelper(IntPtr[], Boolean, Int32) WaitHelper(IntPtr[], Boolean, Int32)

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

Security

InheritanceDemand
Inheritors must have ControlPolicy and ControlEvidence.

Applies to