---
title: HTL_thread_cancel
description: "向线程发送取消指令。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengaccel/system-lib/htl/kunpengaccel_ksl_16_0091.html
sourcePath: /source/zh/kunpengaccel/system-lib/htl/kunpengaccel_ksl_16_0091.html
indexId: a4b1655b904cc0662deaec19362162f6f14c4266fcf50027cb98faec2cbc4d5b68
---
# HTL_thread_cancel

向线程发送取消指令。

#### 接口定义

int HTL_thread_cancel(HTL_thread_t thread);


#### 描述

HTL_thread_cancel()向线程thread发送取消请求。thread可能在其线程函数完成之前终止。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| thread | HTL\_thread\_t | 线程句柄地址。 | 输入 |


#### 返回值

- HTL_THREAD_SUCCESS：成功。
- 其他：失败。见错误码定义。


#### 示例

```
status = HTL_thread_cancel(thread);
if (status != HTL_THREAD_SUCCESS) {
    ......
}
```
