Class DedicatedThreadSynchronizationContext
Represents a SynchronizationContext with a dedicated underlying Thread.
public sealed class DedicatedThreadSynchronizationContext : SynchronizationContext, IDisposable
- Inheritance
-
DedicatedThreadSynchronizationContext
- Implements
- Inherited Members
- Extension Methods
Constructors
DedicatedThreadSynchronizationContext(ThreadParams)
Creates a new DedicatedThreadSynchronizationContext instance.
public DedicatedThreadSynchronizationContext(ThreadParams @params = default)
Parameters
params
ThreadParamsOptional parameters for the underlying thread.
Properties
IsActive
Value indicating the execution status of the underlying thread.
public bool IsActive { get; }
Property Value
ThreadCulture
Culture of the underlying thread.
public CultureInfo ThreadCulture { get; }
Property Value
ThreadId
Unique identifier of the underlying thread.
public int ThreadId { get; }
Property Value
ThreadName
Name of the underlying thread.
public string? ThreadName { get; }
Property Value
ThreadPriority
Value indicating the scheduling priority of the underlying thread.
public ThreadPriority ThreadPriority { get; }
Property Value
ThreadUICulture
UI culture of the underlying thread.
public CultureInfo ThreadUICulture { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
JoinThread()
Joins current thread to the underlying thread of this synchronization context.
public void JoinThread()
Post(SendOrPostCallback, object?)
When overridden in a derived class, dispatches an asynchronous message to a synchronization context.
public override void Post(SendOrPostCallback d, object? state)
Parameters
d
SendOrPostCallbackThe SendOrPostCallback delegate to call.
state
objectThe object passed to the delegate.
Send(SendOrPostCallback, object?)
When overridden in a derived class, dispatches a synchronous message to a synchronization context.
public override void Send(SendOrPostCallback d, object? state)
Parameters
d
SendOrPostCallbackThe SendOrPostCallback delegate to call.
state
objectThe object passed to the delegate.
Exceptions
- NotSupportedException
The method was called in a Windows Store app. The implementation of SynchronizationContext for Windows Store apps does not support the Send(SendOrPostCallback, object) method.