Skip to main content

XTaskQueueRegisterMonitor

Registers a callback that will be invoked whenever a callback is submitted to this queue.

Syntax

Parameters

queue   _In_
Type: XTaskQueueHandle
The queue to register the submit callback to. callbackContext   _In_opt_
Type: void*
An optional context pointer to be passed to the submit callback. callback   _In_
Type: XTaskQueueMonitorCallback*
A callback that will be invoked when a new callback is submitted to the queue. token   _Out_
Type: XTaskQueueRegistrationToken*
A token used when calling XTaskQueueUnregisterMonitor to remove the callback.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
The following example shows how a task queue can be used to signal a condition variable when it has items to dispatch. An application might use this to share threads it uses for the task queue with other work in the application.
SubmitCallback is a helper function that is defined in the code example for the XTaskQueueSubmitCallback function.

Requirements

Header: XTaskQueue.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XTaskQueue members
Asynchronous Programming Model
Async Task Queue Design
Last modified on August 20, 2026