mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-07 13:45:00 -05:00
Fix violations of MISRA rule 13.2
This commit is contained in:
parent
1189198a5e
commit
7a9a41f3eb
1 changed files with 7 additions and 1 deletions
8
tasks.c
8
tasks.c
|
|
@ -3188,7 +3188,13 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
||||||
/* The scheduler is not running, but the task that was pointed
|
/* The scheduler is not running, but the task that was pointed
|
||||||
* to by pxCurrentTCB has just been suspended and pxCurrentTCB
|
* to by pxCurrentTCB has just been suspended and pxCurrentTCB
|
||||||
* must be adjusted to point to a different task. */
|
* must be adjusted to point to a different task. */
|
||||||
if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == uxCurrentNumberOfTasks )
|
|
||||||
|
/* Use temp variable as distinct sequence points for reading
|
||||||
|
* volatile variables prior to a comparison, per the coding guidelines */
|
||||||
|
UBaseType_t uxCurrentListLength = listCURRENT_LIST_LENGTH( &xSuspendedTaskList );
|
||||||
|
UBaseType_T uxCurrentNumOfTasks = uxCurrentNumberOfTasks;
|
||||||
|
|
||||||
|
if( uxCurrentListLength == uxCurrentNumOfTasks )
|
||||||
{
|
{
|
||||||
/* No other tasks are ready, so set pxCurrentTCB back to
|
/* No other tasks are ready, so set pxCurrentTCB back to
|
||||||
* NULL so when the next task is created pxCurrentTCB will
|
* NULL so when the next task is created pxCurrentTCB will
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue