Class SingleThreadedSynchronizationContext
- Namespace
- Microsoft.VisualStudio.Threading
- Assembly
- Microsoft.VisualStudio.Threading.dll
A single-threaded synchronization context, akin to the DispatcherSynchronizationContext and WindowsFormsSynchronizationContext.
public class SingleThreadedSynchronizationContext : SynchronizationContext
- Inheritance
-
SingleThreadedSynchronizationContext
- Inherited Members
- Extension Methods
Remarks
This must be created on the thread that will serve as the pumping thread.
Constructors
SingleThreadedSynchronizationContext()
Initializes a new instance of the SingleThreadedSynchronizationContext class, with the new instance affinitized to the current thread.
public SingleThreadedSynchronizationContext()
Methods
CreateCopy()
public override SynchronizationContext CreateCopy()
Returns
Post(SendOrPostCallback, object?)
public override void Post(SendOrPostCallback d, object? state)
Parameters
d
SendOrPostCallbackstate
object
PushFrame(Frame)
Pushes a message pump on the current thread that will execute work scheduled using Post(SendOrPostCallback, object?).
public void PushFrame(SingleThreadedSynchronizationContext.Frame frame)
Parameters
frame
SingleThreadedSynchronizationContext.FrameThe frame to represent this message pump, which controls when the message pump ends.
Send(SendOrPostCallback, object?)
public override void Send(SendOrPostCallback d, object? state)
Parameters
d
SendOrPostCallbackstate
object