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

# XThreadIsTimeSensitive

> XThreadIsTimeSensitive

# XThreadIsTimeSensitive

指出呼叫執行緒是否被標示為時間敏感。

## 語法

```cpp theme={null}
bool XThreadIsTimeSensitive(  
)  
```

### 參數

無。

### 傳回值

類型：bool

如果呼叫執行緒被標示為時間敏感，則傳回 `true`；否則傳回 `false`。

## 備註

此函式會指出呼叫執行緒是否被設定為*時間敏感執行緒*；在時間敏感執行緒上不應執行封鎖或長時間執行的作業。只有時間敏感安全的 Gaming Runtime Services (GRTS) API 才能在時間敏感執行緒上呼叫。如需詳細資訊，請參閱[時間敏感執行緒](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。

使用 [XThreadSetTimeSensitive](/zh-TW/reference/system/xthread/functions/xthreadsettimesensitive) 函式將執行緒設定為時間敏感或清除其時間敏感設定。此函式會設定或清除執行緒區域儲存區中的一個位元，可供 Gaming Runtime Services (GRTS) API 查詢。

在非時間敏感的方法開頭使用 [XThreadAssertNotTimeSensitive](/zh-TW/reference/system/xthread/functions/xthreadassertnottimesensitive) 函式，以便在時間敏感執行緒上呼叫該方法時中斷進入偵錯工具。

## 需求

**標頭：** XThread.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XThread](/zh-TW/reference/system/xthread/xthread_members)\
[時間敏感執行緒](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)


## Related topics

- [XThreadSetTimeSensitive](/zh-TW/reference/system/xthread/functions/xthreadsettimesensitive.md)
- [XThread (API 內容)](/zh-TW/reference/system/xthread/xthread_members.md)
- [XThreadAssertNotTimeSensitive](/zh-TW/reference/system/xthread/functions/xthreadassertnottimesensitive.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [非同步程式設計的設計目標與改進](/zh-TW/build/core-features/common/async/async-whitepaper.md)
