RT-Thread中event中的set是在接收时还是发送时进行更改值的
时间: 2024-03-08 15:45:43 浏览: 30
在RT-Thread中,event中的set是在发送时进行更改值的。当某个线程完成了某个任务或某个条件满足时,可以调用event_send()函数来设置事件集中的相应事件,以通知等待该事件的线程继续执行。event_send()函数会将指定的事件设置为已发生状态,以便其他线程可以响应该事件。因此,set操作实际上是在发送事件时进行的。
相关问题
RT-Thread中的event_set和event_info是啥意思
在RT-Thread中,`event_set`函数用于设置事件标志组中的某个标志位,`event_info`函数则用于查询事件标志组的状态信息。
具体来说,`event_set`函数的原型为:
```c
void event_set(event_t *event, uint32_t set_flags);
```
其中,`event`是指向事件控制块的指针,`set_flags`则是要设置的标志位,可以是一个或多个标志位的组合。
`event_info`函数的原型为:
```c
uint32_t event_info(event_t *event);
```
它返回事件标志组的状态信息,包括已经设置的标志位和未设置的标志位。
需要注意的是,事件标志组是一种同步机制,用于多任务之间的同步和通信。通过设置和查询事件标志组中的标志位,可以实现任务之间的协作和同步。
RT-Thread中的event事件集中的set是什么意思
在RT-Thread中,event事件集是一种多线程同步机制,用于线程之间的通信和同步。其中,set是指设置事件集中的某个事件。当线程需要等待某个事件发生时,可以调用event_wait()函数等待事件的发生。而当某个线程完成了某个任务或某个条件满足时,可以调用event_send()函数来设置事件集中的相应事件,以通知等待该事件的线程继续执行。因此,set操作实际上是设置事件的状态为已发生,以便其他线程可以响应该事件。
相关推荐
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)