Table of Contents

Class NoMessagePumpSyncContext

Namespace
Microsoft.VisualStudio.Threading
Assembly
Microsoft.VisualStudio.Threading.dll

A SynchronizationContext whose synchronously blocking Wait method does not allow any reentrancy via the message pump.

public class NoMessagePumpSyncContext : SynchronizationContext
Inheritance
NoMessagePumpSyncContext
Inherited Members
Extension Methods

Constructors

NoMessagePumpSyncContext()

Initializes a new instance of the NoMessagePumpSyncContext class.

public NoMessagePumpSyncContext()

Remarks

When using this constructor, Post(SendOrPostCallback, object?) uses the default SynchronizationContext behavior and schedules work on the thread pool, while Send(SendOrPostCallback, object?) uses the default SynchronizationContext behavior and invokes the callback synchronously on the calling thread.

NoMessagePumpSyncContext(SynchronizationContext)

Initializes a new instance of the NoMessagePumpSyncContext class.

public NoMessagePumpSyncContext(SynchronizationContext underlyingSyncContext)

Parameters

underlyingSyncContext SynchronizationContext

The SynchronizationContext that should handle calls to Post(SendOrPostCallback, object?) and Send(SendOrPostCallback, object?).

Properties

Default

Gets a shared instance of this class.

public static SynchronizationContext Default { get; }

Property Value

SynchronizationContext

Methods

Post(SendOrPostCallback, object?)

public override void Post(SendOrPostCallback d, object? state)

Parameters

d SendOrPostCallback
state object

Send(SendOrPostCallback, object?)

public override void Send(SendOrPostCallback d, object? state)

Parameters

d SendOrPostCallback
state object

Wait(IntPtr[], bool, int)

Synchronously blocks without a message pump.

public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)

Parameters

waitHandles IntPtr[]

An array of type IntPtr that contains the native operating system handles.

waitAll bool

true to wait for all handles; false to wait for any handle.

millisecondsTimeout int

The number of milliseconds to wait, or Infinite (-1) to wait indefinitely.

Returns

int

The array index of the object that satisfied the wait.