Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Example
The following example shows how to create a task queue that dispatches both work and completion callbacks on the system thread pool.
void CreatingTaskQueue()
{
XTaskQueueHandle queue;
HRESULT hr = XTaskQueueCreate(
XTaskQueueDispatchMode::ThreadPool,
XTaskQueueDispatchMode::ThreadPool,
&queue);
if (FAILED(hr))
{
printf("Creating queue failed: 0x%x\r\n", hr);
return;
}
SubmitCallbacks(queue);
// Wait a while for the callbacks to run.
Sleep(1000);
XTaskQueueTerminate(queue, true, nullptr, nullptr);
}
Sample output
Worker invoked on thread 11440. Cancel? 0.
Completion invoked on thread 11440. Cancel? 0.