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
underlyingSyncContextSynchronizationContextThe 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
Methods
Post(SendOrPostCallback, object?)
public override void Post(SendOrPostCallback d, object? state)
Parameters
dSendOrPostCallbackstateobject
Send(SendOrPostCallback, object?)
public override void Send(SendOrPostCallback d, object? state)
Parameters
dSendOrPostCallbackstateobject
Wait(IntPtr[], bool, int)
Synchronously blocks without a message pump.
public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
Parameters
waitHandlesIntPtr[]An array of type IntPtr that contains the native operating system handles.
waitAllbooltrue to wait for all handles; false to wait for any handle.
millisecondsTimeoutintThe number of milliseconds to wait, or Infinite (-1) to wait indefinitely.
Returns
- int
The array index of the object that satisfied the wait.