Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

DispatcherQueue Class

Definition

Namespace:
Windows.System

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Manages a prioritized queue on which tasks execute in a serial fashion on a thread.

public ref class DispatcherQueue sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DispatcherQueue final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DispatcherQueue
Public NotInheritable Class DispatcherQueue
Inheritance
Object Platform::Object IInspectable DispatcherQueue
Attributes

Windows requirements

Requirements Description
Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Remarks

All tasks dispatched to a queue execute on the same thread.

Version history

Windows version SDK version Value added
1903 18362 HasThreadAccess

Properties

Name Description
HasThreadAccess

Gets a value indicating whether the DispatcherQueue has access to the current thread.

Methods

Name Description
CreateTimer()

Creates a DispatcherQueueTimer on the DispatcherQueue to execute a task periodically after a time interval has elapsed.

GetForCurrentThread()

Gets the DispatcherQueue associated with the current thread.

TryEnqueue(DispatcherQueueHandler)

Adds a task to the DispatcherQueue which will be executed on the thread associated with the DispatcherQueue.

TryEnqueue(DispatcherQueuePriority, DispatcherQueueHandler)

Adds a task to the DispatcherQueue which will be executed on the thread associated with the DispatcherQueue.

Events

Name Description
ShutdownCompleted

Raised when ShutdownQueueAsync is called. For a full list of the events raised, and in what order, see the Remarks for ShutdownQueueAsync.

ShutdownStarting

Raised when ShutdownQueueAsync is called. For a full list of the events raised, and in what order, see the Remarks for ShutdownQueueAsync.

Applies to

See also


Feedback

Was this page helpful?