---
title: HTL_thread_set_args
description: "设置线程参数。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/251RC1/accel/kunpengaccel_ksl_16_0096.html
sourcePath: /source/zh/kunpengboostkithistory/251RC1/accel/kunpengaccel_ksl_16_0096.html
indexId: f451901d9d9667cef385e1987764f3bce8747d43a4f4e004d614d282dc60d38a76
---
# HTL_thread_set_args

设置线程参数。

#### 接口定义

int HTL_thread_set_args(HTL_thread_t thread, void *thread_args);


#### 描述

HTL_thread_set_args()用于设置线程thread的运行函数的参数thread_args。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| thread | HTL\_thread\_t | 线程句柄。 | 输入 |
| thread\_args | void \* | 运行函数的参数。 | 输入 |


#### 返回值

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


#### 示例

```
HTL_thread_t self;
    self = HTL_thread_self();
    int ret = HTL_thread_set_args(self, (void *)th);
```
