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

# XAsync ライブラリの概要

> XAsync ライブラリの概要

[XAsync](/reference/system/xasync/xasync_members) ライブラリは、非同期タスクとそのコールバックを定義するメソッドとデータを提供します。主要な非同期プリミティブである [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) は、このライブラリで定義されています。これはすべての非同期タスクに必須です。

非同期ブロックに加えて、このライブラリでは、[基本的な非同期呼び出しの開始](/reference/system/xasync/functions/xasyncrun)、[非同期タスクの状態取得](/reference/system/xasync/functions/xasyncgetstatus)、および [タスクのキャンセルの試行](/reference/system/xasync/functions/xasynccancel) のためのメソッドが提供されています。

<a id="xasyncblock" />

## XAsyncBlock

[XAsyncBlock](/reference/system/xasync/structs/xasyncblock) は主要な非同期プリミティブであり、完了コールバックの実装、完了コールバックへのデータの提供、および実行するタスク キューの選択に使用されるメンバーが含まれます。

非同期ブロックには、システムが実行時の動作のために内部的に使用するプライベート データも含まれます。そのため、このブロックを複数のアクティブなタスク間で共有することはできません。呼び出しがアクティブな間、システムはこのデータを使用して非同期呼び出しを識別します。

```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 目次)](/reference/system/xasync/xasync_members)
  * 関数
    * [xasyncrun](/reference/system/xasync/functions/xasyncrun)
    * [xasyncgetstatus](/reference/system/xasync/functions/xasyncgetstatus)
    * [xasynccancel](/reference/system/xasync/functions/xasynccancel)
  * 構造体
    * [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)

## 関連項目

[非同期タスクのセットアップ](/build/core-features/common/async/async-libraries/async-library-xasync-example-setup-async-task)
[単純なタスクの実行](/build/core-features/common/async/async-libraries/async-library-xasync-example-run-simple-task)
[Microsoft Game Development Kit API タスクの実行](/build/core-features/common/async/async-libraries/async-library-xasync-example-run-gdk-task)
[XAsync system API 目次](/reference/system/xasync/xasync_members)


## Related topics

- [非同期タスクのセットアップ例](/ja-jp/build/core-features/common/async/async-libraries/async-library-xasync-example-setup-async-task.md)
- [Microsoft Game Development Kit API タスクの実行例](/ja-jp/build/core-features/common/async/async-libraries/async-library-xasync-example-run-gdk-task.md)
- [単純なタスクの実行例](/ja-jp/build/core-features/common/async/async-libraries/async-library-xasync-example-run-simple-task.md)
- [非同期プログラミングの概要](/ja-jp/build/core-features/common/async/async-toc.md)
- [XAsyncProvider ライブラリの概要](/ja-jp/build/core-features/common/async/async-libraries/async-library-xasyncprovider.md)
