![]() |
RT-Thread API参考手册
4.0.3
嵌入式实时操作系统
|
等待队列接口 更多...
结构体 | |
| struct | rt_wqueue |
| 等待队列控制块 更多... | |
| struct | rt_wqueue_node |
| 等待队列节点 更多... | |
宏定义 | |
| #define | RT_WQ_FLAG_CLEAN 0x00 |
| 等待队列清除 | |
| #define | RT_WQ_FLAG_WAKEUP 0x01 |
| 等待队列唤醒 | |
| #define | DEFINE_WAIT_FUNC(name, function) |
| 定义等待队列 更多... | |
类型定义 | |
| typedef struct rt_wqueue | rt_wqueue_t |
| 等待队列类型指针定义 | |
| typedef int(* | rt_wqueue_func_t) (struct rt_wqueue_node *wait, void *key) |
| 等待队列回调函数类型定义 | |
| typedef struct rt_wqueue_node | rt_wqueue_node_t |
| 等待队列类型定义 | |
函数 | |
| int | rt_wqueue_wait (rt_wqueue_t *queue, int condition, int timeout) |
| 加入等待队列 更多... | |
| void | rt_wqueue_wakeup (rt_wqueue_t *queue, void *key) |
| 唤醒等待队列 更多... | |
等待队列接口
| #define DEFINE_WAIT_FUNC | ( | name, | |
| function | |||
| ) |
定义等待队列
| name | 等待队列名称 |
| function | 等待队列唤醒条件判断函数,由客户定义 |
| int rt_wqueue_wait | ( | rt_wqueue_t * | queue, |
| int | condition, | ||
| int | timeout | ||
| ) |
加入等待队列
在指定等待队列上挂起等待或超时返回。
| queue | 等待队列句柄 |
| condition | 与POSIX 标准接口兼容的参数(目前没有意义,传入0即可)。 |
| timeout | 指定的等待时间。 |
| void rt_wqueue_wakeup | ( | rt_wqueue_t * | queue, |
| void * | key | ||
| ) |
唤醒等待队列
唤醒指定等待队列上符合条件的被挂起的线程。
| queue | 等待队列句柄 |
| key | 唤醒条件 |