---
title: HTL_thread_executor_set_scheduler
description: "根据类型设置执行器的调度器。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0059.html
sourcePath: /source/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0059.html
indexId: 36af9acc6c4936d672cba0a63ad63898b744b2e8a9d681e7ab51d7b7ece4bf4674
---
# HTL_thread_executor_set_scheduler

根据类型设置执行器的调度器。

#### 接口定义

int HTL_thread_executor_set_scheduler(HTL_thread_executor_t executor, HTL_thread_scheduler_type_t sched_type, HTL_thread_pool_t *thread_pools, int pool_count);


#### 描述

HTL_thread_executor_set_scheduler()用于设置执行器的调取器为某一个sched_type类型。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| executor | HTL\_thread\_executor | 执行器句柄。 | 输入 |
| sched\_type | HTL\_thread\_scheduler\_type\_t | 预定义调度器。 | 输入 |
| thread\_pools | HTL\_thread\_pool\_t \* | 线程池地址。 | 输入 |
| pool\_count | int | 池数量。 | 输入 |


#### 返回值

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


#### 示例

```
HTL_thread_executor_self(&executors[0]);
HTL_thread_executor_set_scheduler(executors[0], HTL_THREAD_SCHEDULER_DEFAULT, &pools[0], 1);
```
