> ## 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.

# XAsyncCompletionRoutine

> XAsyncCompletionRoutine

# XAsyncCompletionRoutine

비동기 호출에 대한 완료 콜백을 나타냅니다.

## 구문

```cpp theme={null}
void XAsyncCompletionRoutine(  
         XAsyncBlock* asyncBlock  
)  
```

### 매개 변수

*asyncBlock*   \_Inout\_\
형식: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

완료 콜백에 대한 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)에 대한 포인터입니다.

### 반환 값

형식: void

## 설명

비동기 호출에 대한 *완료 콜백*을 제공하기 위해 `XAsyncCompletionRoutine` 포인터를 선택적으로 지정할 수 있습니다. 완료 콜백은 비동기 호출이 완료된 후 실행되는 콜백 함수입니다. 비동기 호출에 대한 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) 구조체의 `callback` 멤버에 `XAsyncCompletionRoutine` 포인터를 지정할 수 있습니다.

일반적으로 완료 콜백은 다른 스레드에서 비동기 호출의 결과를 처리합니다. 완료 콜백은 비동기 호출이 완료될 때 호출되는 콜백 함수를 나타냅니다. 콜백 함수는 `XAsyncBlock` 포인터를 사용하며, 이는 이후에 콜백 함수의 결과를 얻는 데 사용됩니다.

완료 콜백을 지정하면 [XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus) 함수를 사용하여 완료 콜백이 완료되었는지 주기적으로 확인한 다음 필요에 따라 [XAsyncGetResult](/reference/system/xasyncprovider/functions/xasyncgetresult) 및 [XAsyncGetResultSize](/reference/system/xasync/functions/xasyncgetresultsize)를 사용하여 완료된 작업에서 결과를 가져올 수 있습니다.

[XAsyncCancel](/reference/system/xasync/functions/xasynccancel)을 호출하여 비동기 호출을 취소하더라도 완료 콜백이 호출됩니다.

[XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus) 또는 완료 콜백의 `Get\*Result` 메서드를 사용하여 비동기 호출의 결과를 얻습니다. 비동기 호출이 취소된 경우 이러한 메서드는 `E_ABORT`를 반환합니다. `Get\*Result` 메서드를 포함하여 비동기 공급자의 구현 패턴에 대한 자세한 내용은 [비동기 프로그래밍 모델](/build/core-features/common/async/async-programming-model)을 참조하세요.

## 요구 사항

**헤더:** XAsync.h

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

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

## 개념 설명서

* [비동기 프로그래밍 모델](/build/core-features/common/async/async-programming-model)

## 함께 보기

[XAsync 멤버](/reference/system/xasync/xasync_members)\
[XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus)\
[비동기 프로그래밍 모델](/build/core-features/common/async/async-programming-model)


## Related topics

- [XAsyncCancel](/ko/reference/system/xasync/functions/xasynccancel.md)
- [비동기 프로그래밍 모델](/ko/build/core-features/common/async/async-programming-model.md)
- [XAsync](/ko/reference/system/xasync/xasync_members.md)
- [XAsyncBlock](/ko/reference/system/xasync/structs/xasyncblock.md)
- [Xmemalloc routine](/ko/reference/system/xmem/functions/xmemalloc_routine.md)
