FreeRTOS源码解析 -> vTaskResume()
来源:互联网 发布:iphone铃声下载软件 编辑:程序博客网 时间:2024/05/29 10:12
#if ( INCLUDE_vTaskSuspend == 1 )void vTaskResume( xTaskHandle pxTaskToResume ){ tskTCB *pxTCB;/* It does not make sense to resume the calling task. */configASSERT( pxTaskToResume );/* Remove the task from whichever list it is currently in, and placeit in the ready list. */pxTCB = ( tskTCB * ) pxTaskToResume;/* The parameter cannot be NULL as it is impossible to resume thecurrently executing task. *///要恢复的task不为空并且不是当前正在运行的task(如果是当前运行的还恢复个毛线)//熟悉的链表操作啊if( ( pxTCB != NULL ) && ( pxTCB != pxCurrentTCB ) ){//进入临界区taskENTER_CRITICAL();{//判断要恢复的task是否在挂起列表中if( xTaskIsTaskSuspended( pxTCB ) == pdTRUE ){traceTASK_RESUME( pxTCB );/* As we are in a critical section we can access the readylists even if the scheduler is suspended. *///从挂起链表中删除,加入到ready队列中(恢复到就绪态)vListRemove( &( pxTCB->xGenericListItem ) );prvAddTaskToReadyQueue( pxTCB ); //如果恢复的task优先级比当前正在运行的任务的优先级高,强制一次任务调度//这里为什么不去判断当前调度器是否在运行(之前可是都判断了的)????/* We may have just resumed a higher priority task. */if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority ){/* This yield may not cause the task just resumed to run, butwill leave the lists in the correct state for the next yield. *//*强制进行一次上下文切换*/portYIELD_WITHIN_API();}}}//退出临界区taskEXIT_CRITICAL();}}#endif
0 0
- FreeRTOS源码解析 -> vTaskResume()
- FreeRTOS源码解析 -> xTaskCreate()
- FreeRTOS源码解析 -> vTaskDelete()
- FreeRTOS源码解析 -> vTaskDelayUntil()
- FreeRTOS源码解析 -> vTaskSuspend
- FreeRTOS源码解析 -> vTaskStartScheduler()
- Tracealyzer for FreeRTOS(FreeRTOS+Trace) 详解(源码解析+移植)
- Tracealyzer for FreeRTOS(FreeRTOS+Trace) 详解(源码解析+移植)
- FreeRTOS之源码及移植解析
- FreeRTOS的队列发送源码解析
- FreeRTOS 源码注释(xTaskGenericCreate)
- FreeRTOS 源码注释(vTaskDelete)
- FreeRTOS 源码注释(vTaskDelayUntil)
- FreeRTOS 源码注释(vTaskDelay)
- FreeRTOS 源码注释(vTaskSuspend)
- FreeRTOS 源码注释(prvAllocateTCBAndStack)
- FreeRTOS 源码注释(prvInitialiseTCBVariables)
- FreeRTOS 源码注释(prvInitialiseTaskLists)
- MySQL InnoDB锁机制(二)
- hbase 异常 未解决
- MySQL InnoDB锁机制(三)
- 权限数据库设计
- Container With Most Water
- FreeRTOS源码解析 -> vTaskResume()
- 李开复:算法的力量
- liferay jsp如何得到某个文件如 ”language.properties"
- 黑马程序员——ARC的基本原理和@property的使用
- 【线段树】 Codeforces 500E New Year Domino
- 解决 “错误3 :error MSB4036: 未找“SetEnvironmentVariable”任务。” 类似错误的一个办法
- IAP-应用内购买流程
- Mac OS X 10.10, Eclipse+ADT真机调试代码时,Device Chooser中不显示真机的解决方案(续)
- UIImagePickerController 内存警告研究