if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) { /* Is task suspended? */
OSRdyGrp |= ptcb->OSTCBBitY; /* No, Make ready */
OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
OS_EXIT_CRITICAL();
OS_Sched(); /* See if this is new highest priority */
} else {
OS_EXIT_CRITICAL(); /* Task may be suspended */
}
return (OS_ERR_NONE);
}
#endif
上面的代码前面是有效性判断,后面对prio优先级别的任务TCB的OSTCBDly=0操作,最后如果此 OSTCBPrioTbl[prio]任务没有挂起,则进行一个任务级别的任务切换操作OS_Sched()。 |