当前位置:网站首页>B_QuRT_User_Guide(18)
B_QuRT_User_Guide(18)
2022-06-11 02:39:00 【weixin_38498942】
B_QuRT_User_Guide(18)
11.6 qurt_sem_init_val()
11.6.1 Function Documentation
11.6.1.1 void qurt_sem_init_val ( qurt_sem_t ∗ sem, unsigned short val )
用指定的值初始化一个semaphore对象。
相关数据类型
qurt_sem_t
参数
返回值
None.
依赖关系
None.
11.7 qurt_sem_try_down()
11.7.1 Function Documentation
11.7.1.1 int qurt_sem_try_down ( qurt_sem_t ∗ sem )
请求访问一个共享资源(没有暂停)。当一个线程对一个
时,其结果取决于semaphore的计算值。
- 当计数值为非零时,会被递减。Down操作返回0作为函数结果,线程获得对共享资源的访问权,并可以继续执行。
- 当计数值为零时,不会被递减。下线操作返回-1作为函数结果,线程不能获得对共享资源的访问权,不应继续执行。
相关数据类型
qurt_sem_t
参数
返回值
0 – Success. -1 – Failure.
依赖关系
None.
11.8 qurt_sem_up()
11.8.1 Function Documentation
11.8.1.1 static int qurt_sem_up ( qurt_sem_t ∗ sem )
释放对一个共享资源的访问。当一个线程在一个semaphore上执行向上操作时,semaphore的计数值会被增加。其结果取决于在该信号上等待的线程的数量。
- 当没有线程在等待时,当前线程释放对共享资源的访问并继续执行。
- 当有一个或多个线程在等待,并且semaphore的数值非零时,内核会唤醒优先级最高的等待线程,并递减semaphore的数值。如果被唤醒的线程比当前线程有更高的优先级,那么就会发生上下文切换。
相关数据类型
qurt_sem_t
参数
返回值
Unused integer value.
依赖关系
None.
11.9 qurt_sem_down_timed()
11.9.1 Function Documentation
11.9.1.1 int qurt_sem_down_timed ( qurt_sem_t ∗ sem, unsigned long long int duration )
当一个线程对一个信号灯进行向下操作时,其结果取决于信号灯的计数值。
- 当计数值为非零时,它被递减,线程获得对共享资源的访问权并继续执行。
- 当计数值为零时,它不会被递减,线程在信号灯上被暂停。当计数值变为非零时(因为另一个线程释放了该信号),它被递减,被暂停的线程被唤醒并获得对共享资源的访问。当指定的超时时间过后,终止等待。如果超时过后,终止该等待并不授予对共享资源的访问权。
相关数据类型
qurt_sem_t
参数
返回值
QURT_EOK – Success QURT_ETIMEDOUT – Timeout
依赖关系
None.
11.10 Data Types
本节描述了信号灯服务的数据类型。
- 在QuRT中,semaphores被表示为qurt_sem_t类型的对象。
11.10.1 Data Structure Documentation
11.10.1.1 union qurt_sem_t
QuRT信号类型。
边栏推荐
- error exepected identifier before ‘(‘ token, grpc 枚举类编译错误
- GraphAcademy 课程讲解:《Neo4j 图数据科学基础》
- AOSP ~ modify WebView default implementation
- Istio安装与使用
- [MySQL 45 lecture -12] lecture 12 the reason why MySQL has a wind attack from time to time
- 【长时间序列预测】Aotoformer 代码详解之[3]模型整体架构分析
- Uni app - one click access to user information
- [long time series prediction] aotoformer code detailed [3] model overall architecture analysis
- 你的公司会选择开发数据中台吗?
- 求MySQL先按大于等于当前时间升序排序,再按小于当前时间降序排序
猜你喜欢
随机推荐
[implementation of bubble sorting]
Uni app - one click access to user information
Arduino Uno接JQ8900-16p语音播报模块
MySQL is required to sort in ascending order greater than or equal to the current time, and then in descending order less than the current time
微信小程序
Prophet
深入解析问号表达式
CPT 102_ LEC 15
蓝桥杯_小蓝吃糖果_鸽巢原理 / 抽屉原理
Databinding escaping with presentation symbols
Question bank and answers for 2022 melting welding and thermal cutting operation certificate examination
WordPress upgrade error: briefly unavailable for scheduled maintenance [resolved]
Construction of Flink development environment and wordcount
CPT 102_LEC 18
Byte beating | the first batch of written examination for game R & D post (question solution)
AOSP ~ WiFi on by default + GPS off by default + Bluetooth off by default + rotary screen off
Openjudge noi 1.13 17: text layout
helm 部署traefik ingress
CocosCreator原生二次开发的正确姿势
Error excluded identifier before '(' token, grpc enumeration class compilation error









