/*‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐*/
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
{
/*The list item knows which list it is in. Obtain the list from the list*/
/*链表项知道它在哪个链表中。获取节点所在链表*/
List_t * const pxList = ( List_t * ) pxItemToRemove‐>pvContainer;
/* 调整链表的节点索引指针 */
pxItemToRemove‐>pxNext‐>pxPrevious = pxItemToRemove‐>pxPrevious;
pxItemToRemove‐>pxPrevious‐>pxNext = pxItemToRemove‐>pxNext;
/* Only used during decision coverage testing. */
/*仅在决策覆盖率测试期间使用*/
mtCOVERAGE_TEST_DELAY();
/* Make sure the index is left pointing to a valid item. */
/*确保索引指向有效项*/
if( pxList‐>pxIndex == pxItemToRemove )
{
pxList‐>pxIndex = pxItemToRemove‐>pxPrevious;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
/* 初始化该节点所在的链表为空,表示节点还没有插入任何链表 */
pxItemToRemove‐>pvContainer = NULL;
/* 链表节点计数器‐‐ */
( pxList‐>uxNumberOfItems )‐‐;
/* 返回链表中剩余节点的个数 */
return pxList‐>uxNumberOfItems;
}
/*‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐*/
将节点从链表中移出(删除) 详细过程如下图 ,参考<[野火®]《FreeRTOS 内核实现与应用开发实战—基于STM32》>