Class SingleThreadSynchronizationContext
- Namespace
- CarinaStudio.Threading
- Assembly
- CarinaStudio.AppBase.Core.dll
Implementation of SynchronizationContext which uses single execution thread to handle posted call-backs. This is thread-safe class.
public class SingleThreadSynchronizationContext : SynchronizationContext, IDisposable
- Inheritance
-
SingleThreadSynchronizationContext
- Implements
- Inherited Members
- Extension Methods
Constructors
SingleThreadSynchronizationContext(string?, bool)
Initialize new SingleThreadSynchronizationContext instance.
public SingleThreadSynchronizationContext(string? name = null, bool isBackground = true)
Parameters
Properties
ExecutionThread
Get execution thread.
public Thread ExecutionThread { get; }
Property Value
Name
Get name.
public string? Name { get; }
Property Value
Methods
Dispose()
Dispose the instance.
public void Dispose()
Post(SendOrPostCallback, object?)
Post a call-back.
public override void Post(SendOrPostCallback callback, object? state)
Parameters
callbackSendOrPostCallbackCall-back.
stateobjectCustom state passed to call-back.
Send(SendOrPostCallback, object?)
Send a call-back and wait for execution completed.
public override void Send(SendOrPostCallback callback, object? state)
Parameters
callbackSendOrPostCallbackCall-back.
stateobjectCustom state passed to call-back.