---
title: HTL_thread_executor_check_event
description: "处理与调度器关联的事件。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengaccel/system-lib/htl/kunpengaccel_ksl_16_0062.html
sourcePath: /source/zh/kunpengaccel/system-lib/htl/kunpengaccel_ksl_16_0062.html
indexId: 1394a2f36637167772c1609e5df6fa77a5eb481746fe22563820221f8e60b4a268
---
# HTL_thread_executor_check_event

处理与调度器关联的事件。

#### 接口定义

int HTL_thread_executor_check_event(HTL_thread_scheduler_t scheduler);


#### 描述

HTL_thread_executor_check_event()处理与调度器scheduler关联的事件。正在调用的工作单元需与scheduler相关联。

该函数仅由调度器程序定期执行，如用户自定义的调度器应该在调度循环中定期调用。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| scheduler | HTL\_thread\_scheduler\_t | 调度器句柄。 | 输入 |


#### 返回值

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


#### 示例

```
while (1) {
        if (++work_count >= p_data->event_freq) {
            work_count = 0;
            HTL_thread_scheduler_stop(sched, &stop);
            if (stop == true)
                break;
            HTL_thread_executor_check_event(sched);
        }
    }
```
