Closed chinglee-iot closed 2 months ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Attention: Patch coverage is 0%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 93.00%. Comparing base (
8c49c54
) to head (ae38d50
). Report is 7 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
tasks.c | 0.00% | 0 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
The macro
portGET_CRITICAL_NESTING_COUNT
is implemented like the following:It involves the following 2 steps:
portGET_CORE_ID()
.pxCurrentTCBs
and correspondingpxCurrentTCB
.If a context switch happens between step 1 and step 2, the core ID may be changed as the task may be scheduled on a different core. In that case, we would end up accessing the wrong TCB and thereby, wrong critical nesting count.
This PR address the issue by ensuring that
portGET_CRITICAL_NESTING_COUNT
is called with interrupts disabled to ensure atomicity.Test Steps
Before this PR There will be assertion in
vTaskSuspendAll()
if running this XMOS demo.Checklist:
The following unit test is fixed in https://github.com/FreeRTOS/FreeRTOS/pull/1204
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.