> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XTaskQueueCallback

> XTaskQueueCallback

# XTaskQueueCallback

작업 큐에 의해 호출되는 콜백입니다.

## 구문

```cpp theme={null}
void XTaskQueueCallback(  
         void* context,  
         bool canceled  
)  
```

### 매개 변수

*context*   \_In\_opt\_\
형식: void\*

선택 사항. [XTaskQueueSubmitCallback](/reference/system/xtaskqueue/functions/xtaskqueuesubmitcallback)을 호출할 때 전달된 컨텍스트 포인터입니다.

*canceled*   \_In\_\
형식: bool

true인 경우 작업 큐가 종료되고 있어 콜백이 취소됩니다.

### 반환 값

형식: void

## 설명

`XTaskQueueCallback` 콜백은 작업 큐에서 작업을 수행하기 위해 구현됩니다. 콜백은 [XTaskQueueSubmitCallback](/reference/system/xtaskqueue/functions/xtaskqueuesubmitcallback) 또는 [XTaskQueueSubmitDelayedCallback](/reference/system/xtaskqueue/functions/xtaskqueuesubmitdelayedcallback)을 호출하여 작업 큐의 작업 포트 또는 완료 포트에 제출할 수 있습니다. 작업 큐의 작업 포트와 완료 포트는 독립적인 디스패치 모드를 가질 수 있으며, `XTaskQueueCallback` 콜백은 두 포트 중 어느 쪽에도 제출할 수 있습니다. 일반적으로 작업 포트에 제출된 콜백은 작업을 완료한 후 해당하는 콜백을 완료 포트에 다시 제출합니다.

`canceled` 매개 변수의 목적은 콜백이 취소된 경우 콜백에서 할당한 리소스가 올바르게 해제될 수 있도록 하는 것입니다. `XTaskQueueCallback` 콜백이 호출되고 `canceled`가 true로 설정된 경우, 해당 콜백의 작업 큐가 [XTaskQueueTerminate](/reference/system/xtaskqueue/functions/xtaskqueueterminate) 호출로 종료되었으며 콜백이 취소된 것입니다. 콜백은 `context`에 할당된 메모리를 포함하여 모든 할당된 리소스를 해제하고 다른 작업은 수행하지 않아야 합니다.

예제를 보려면 [콜백 제출](/build/core-features/common/async/async-task-queue-design-howto/submitting-callbacks)을 참조하세요.

## 요구 사항

**헤더:** XTaskQueue.h

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XTaskQueue 멤버](/reference/system/xtaskqueue/xtaskqueue_members)\
[비동기 프로그래밍 모델](/build/core-features/common/async/async-programming-model)\
[비동기 작업 큐 디자인](/build/core-features/common/async/async-task-queue-design)


## Related topics

- [XTaskQueueSubmitCallback](/ko/reference/system/xtaskqueue/functions/xtaskqueuesubmitcallback.md)
- [XTaskQueueSubmitDelayedCallback](/ko/reference/system/xtaskqueue/functions/xtaskqueuesubmitdelayedcallback.md)
- [XTaskQueue](/ko/reference/system/xtaskqueue/xtaskqueue_members.md)
- [XTaskQueueRegisterWaiter](/ko/reference/system/xtaskqueue/functions/xtaskqueueregisterwaiter.md)
- [비동기 작업 큐 설계](/ko/build/core-features/common/async/async-task-queue-design.md)
