Closed chinglee-iot closed 4 months ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 93.00%. Comparing base (
cff947a
) to head (9f6f787
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
pxIndex
inList_t
should only be used when selecting next task to run. AlteringpxIndex
of a ready list will cause the scheduler unable to select the right task to run.Use
prvListTasksWithinSingleList
as an example.prvListTasksWithinSingleList
is called inuxTaskGetSystemState
andpxIndex
is used to traverse the ready list inlistGET_OWNER_OF_NEXT_ENTRY
. This will cause thepxIndex
points to a different task afteruxTaskGetSystemState
is called. Single core FreeRTOS make use ofpxIndex
to select next task to run. The scheduler will select wrong task since thepxIndex
is moved. This also causes problem In FreeRTOS SMP aspxIndex
is not moved in SMP and it should always point toxListEnd
.Example code
The result shows that print pxReadyTasksLists[1].pxIndex points to different items in the list after calling
uxTaskGetSystemState
.In this PR
Test Steps
Running the example above.
pxIndex
should not be changed afteruxTaskGetSystemState
is called.Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.