Class ThreadSynchronizationContext
Provides a SynchronizationContext implementation that can be used in console applications or any thread which doesn't have its own SynchronizationContext.
Inheritance
System.Object
System.Threading.SynchronizationContext
ThreadSynchronizationContext
Namespace:Microsoft.SqlTools.ServiceLayer.Utility
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class ThreadSynchronizationContext : SynchronizationContext
Methods
| Improve this Doc View SourceEndLoop()
Ends the SynchronizationContext message loop.
Declaration
public void EndLoop()
Post(SendOrPostCallback, Object)
Posts a request for execution to the SynchronizationContext. This will be executed on the SynchronizationContext's thread.
Declaration
public override void Post(SendOrPostCallback callback, object state)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.SendOrPostCallback | callback | The callback to be invoked on the SynchronizationContext's thread. |
| System.Object | state | A state object to pass along to the callback when executed through the SynchronizationContext. |
RunLoopOnCurrentThread()
Starts the SynchronizationContext message loop on the current thread.
Declaration
public void RunLoopOnCurrentThread()