当前位置:网站首页>1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析
1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析
2022-07-05 06:50:00 【grey_csdn】
全部学习汇总: GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
前面刚刚分析完了任务的挂起操作,接下来分析一下任务是否是挂起状态的查询接口实现。一般,这种查询类的接口实现上总是简单一些。

接口也是需要配置一个宏定义使能之后才能够生效,这个跟前面的任务挂起接口实现是相似的。接下来,首先得确保传入的任务句柄是有效的。

如果任务句柄有效,那么就需要查看任务是否在挂起任务链表之中。如果不在,那么查询就直接得到结果,这个任务并没有挂起。否则,需要进一步判断。这也就说明,在FreeRTOS之中这个挂起的任务链表可能用到了多个功能之中,而这导致了链表的重用。自然,有些时候把链表增加一些类别能够让处理更加简单,但是类似的处理就无法合并了。因此,这样实现下来的内核应该更加轻巧。
如果任务在挂起任务链表只中,挂起的原因可能也是因为事件导致的挂起。如此,判断一下是否是事件导致的挂起即可,如果不是,那么这个任务在挂起任务链表中的原因就是挂起任务的操作。如此,任务就是挂起状态。
相比之前的挂起操作,这个判断任务是否挂起的操作的确是简单了一些。主要的原因其实之前也分析过,类似的属性查询一般不会改变各种状态因此不会触发任务的调度。而修改类的接口则不一样了,可能会涉及到优先级等关键的属性,随时可能触发任务调度,因此复杂度会高一些。
边栏推荐
- Record of problems in ollvm compilation
- Vscode configures the typera editor for MD
- [MySQL 8.0 does not support capitalization of table names - corresponding scheme]
- Ros2 - install ros2 (III)
- [algorithm post interview] interview questions of a small factory
- Volcano resource reservation feature
- Redis-01. First meet redis
- The differences and connections among cookies, sessions, JWT, and tokens
- H5 module suspension drag effect
- 使用paping工具进行tcp端口连通性检测
猜你喜欢

Orin installs CUDA environment

程序中的负数存储及类型转换

1. Create Oracle database manually

namespace

Rehabilitation type force deduction brush question notes D2

. Net core stepping on the pit practice
![[Gaode map POI stepping pit] amap Placesearch cannot be used](/img/4c/55586ffcc2267c477a4532ab51a0c1.png)
[Gaode map POI stepping pit] amap Placesearch cannot be used

Adg5412fbruz-rl7 applies dual power analog switch and multiplexer IC

并发编程 — 如何中断/停止一个运行中的线程?

达梦数据库全部
随机推荐
Skywalking all
inux摄像头(mipi接口)简要说明
Database mysql all
UIO driven framework
PHY驱动调试之 --- MDIO/MDC接口22号和45号条款(一)
vim
Sre core system understanding
Xiaomi written test real question 1
Empire help
Orin installs CUDA environment
Cloud native related technology learning
Vscode editor
Ros2 - ros2 vs. ros1 (II)
微信小程序路由再次跳轉不觸發onload
Preemption of CFS scheduling
Speedtree01 generator properties
Ros2 - first acquaintance with ros2 (I)
睿智的目标检测59——Pytorch Focal loss详解与在YoloV4当中的实现
Redis-02. Redis command
Utf8 encoding