Skip to main content

XTaskQueueSubmitCallback

Submits a callback to the queue for the given port.

Syntax

Parameters

queue   _In_
Type: XTaskQueueHandle
The queue to submit the callback to. port   _In_
Type: XTaskQueuePort
The port to submit the callback to. Callbacks can be assigned to work or completion ports. callbackContext   _In_opt_
Type: void*
An optional context pointer that will be passed to the callback. callback   _In_
Type: XTaskQueueCallback*
A pointer to the callback function.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

alert Performance Note:
Adding an item to a queue needs to be lock and wait free in order to satisfy the performance requirements of upstream code. The following APIs are lock free:
The following example demonstrates how a callback is submitted to either the work or completion port of a task queue. It first submits a work callback, and then at the end of the work callback it submits a completion callback, which will be typical.

Requirements

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

See also

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