---
title: HTL_thread_cancel
description: "向线程发送取消指令。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0091.html
sourcePath: /source/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0091.html
indexId: b2098e86011800576f1740ae45168504336f3e343ea15da38f4f8ed79394e1fe74
---
# 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) {
......
}
```
