nobody wrote on Thursday, June 23, 2005:
1. sometimes , one task want to yield to another task by calling taskYIELD(). But before the task do it, the ISRs maybe have taked place and yield to another in the end of the ISRs. So when control return to that task which will call taskYIELD(), it is unnecessary to yield again.
method to solve it : using context count
// how to use context count
… do something else…
xSavedContextCount = xTaskContextCount(); // get the current Context change Count
__if (xTaskContextCount() != xSavedContextCount)
____// go on yield
in vTaskDelayUntil , vTaskDelay
at line 308 in xQueueSend
at line 437 in xQueueReceive ,
there are some code like below
if( !xTaskResumeAll() )
but it’s not completely appropriate to call taskYIELD() when xTaskResumeAll() return pdFALSE because before calling taskYIELD() ISRs maybe also put the current task in the Readylist. So its need not yield again and current task has meet it’s requirement and can go on.
So these code can be
if (current task is not in the readylist)
these method may be useful.