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

# XAsync 라이브러리 개요

> XAsync 라이브러리는 모든 비동기 작업에 필요한 XAsyncBlock 구조체와 함께 호출 시작, 상태 확인, 작업 취소를 위한 함수를 정의합니다.

[XAsync](https://docs.xbox.com/ko/reference/system/xasync/xasync_members.md) 라이브러리는 비동기 작업과 해당 콜백을 정의하는 메서드와 데이터를 제공합니다. 주요 비동기 기본 형식인 [XAsyncBlock](https://docs.xbox.com/ko/reference/system/xasync/structs/xasyncblock.md)이 이 라이브러리에서 정의됩니다. 이는 모든 비동기 작업에 필요합니다.

async 블록 외에도 이 라이브러리는 [기본 비동기 호출 시작](https://docs.xbox.com/ko/reference/system/xasync/functions/xasyncrun.md), [비동기 작업 상태 가져오기](https://docs.xbox.com/ko/reference/system/xasync/functions/xasyncgetstatus.md), [작업 취소 시도](https://docs.xbox.com/ko/reference/system/xasync/functions/xasynccancel.md)를 위한 메서드를 제공합니다.

## XAsyncBlock

[XAsyncBlock](https://docs.xbox.com/ko/reference/system/xasync/structs/xasyncblock.md)은 완료 콜백을 구현하고, 완료 콜백에 데이터를 제공하며, 실행할 작업 큐를 선택하는 데 사용되는 멤버가 포함된 주요 비동기 기본 형식입니다.

async 블록에는 시스템이 런타임 동작에 내부적으로 사용하는 프라이빗 데이터도 포함되어 있습니다. 따라서 이 블록은 여러 활성 작업 간에 공유할 수 없습니다. 시스템은 호출이 활성화되어 있는 동안 이 데이터를 사용하여 비동기 호출을 식별합니다.

```c++ theme={null}
struct XAsyncBlock
{
    /// <summary>
    /// The queue to queue the call on.
    /// </summary>
    XTaskQueueHandle queue;
    
    /// <summary>
    /// Optional context pointer to pass to the callback.
    /// </summary>
    void* context;
    
    /// <summary>
    /// Optional callback that is invoked when the call completes.
    /// </summary>
    XAsyncCompletionRoutine* callback;
    
    /// <summary>
    /// Internal use only.
    /// </summary>
    unsigned char internal[sizeof(void*) * 4];
};
```

## 참고 API 문서

* [XAsync(API 콘텐츠)](https://docs.xbox.com/ko/reference/system/xasync/xasync_members.md)
  * 함수
    * [xasyncrun](https://docs.xbox.com/ko/reference/system/xasync/functions/xasyncrun.md)
    * [xasyncgetstatus](https://docs.xbox.com/ko/reference/system/xasync/functions/xasyncgetstatus.md)
    * [xasynccancel](https://docs.xbox.com/ko/reference/system/xasync/functions/xasynccancel.md)
  * 구조체
    * [XAsyncBlock](https://docs.xbox.com/ko/reference/system/xasync/structs/xasyncblock.md)

## 참고 항목

[비동기 작업 설정](https://docs.xbox.com/ko/build/core-features/common/async/async-libraries/async-library-xasync-example-setup-async-task.md)
[간단한 작업 실행](https://docs.xbox.com/ko/build/core-features/common/async/async-libraries/async-library-xasync-example-run-simple-task.md)
[Microsoft Game Development Kit API 작업 실행](https://docs.xbox.com/ko/build/core-features/common/async/async-libraries/async-library-xasync-example-run-gdk-task.md)
[XAsync 시스템 API 콘텐츠](https://docs.xbox.com/ko/reference/system/xasync/xasync_members.md)


## Related topics

- [XAsyncBlock](https://docs.xbox.com/ko/reference/system/xasync/structs/xasyncblock.md)
- [XAsync (API 콘텐츠)](https://docs.xbox.com/ko/reference/system/xasync/xasync_members.md)
- [XAsyncCancel](https://docs.xbox.com/ko/reference/system/xasync/functions/xasynccancel.md)
- [Microsoft Game Development Kit(GDK) API 작업 실행](https://docs.xbox.com/ko/build/core-features/common/async/async-libraries/async-library-xasync-example-run-gdk-task.md)
- [XAsyncGetStatus](https://docs.xbox.com/ko/reference/system/xasync/functions/xasyncgetstatus.md)
