Closed Dazza0 closed 8 months ago
@chinglee-iot I've updated the CMock unit tests as well. PTAL.
The SonarCloud Quality Gate passed, but some issues were introduced.
2 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Attention: 3 lines
in your changes are missing coverage. Please review.
Comparison is base (
57a5ed7
) 93.55% compared to head (63c8d73
) 93.52%.
Files | Patch % | Lines |
---|---|---|
tasks.c | 89.65% | 0 Missing and 3 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/612 fixed an issue with
ulTaskGenericNotifyTake()
andxTaskGenericNotifyWait()
being non deterministic by ensuring that those functions callprvAddCurrentTaskToDelayedList()
while the scheduler was suspended. The merged fix would suspend the scheduler while still in a critical section, then exit the critical section while the scheduler was suspended:The method above technically works but is a bit unintuitive due to interleaving critical sections and scheduler suspension.
This PR updates the behavior described above by wrapping the critical section in a scheduler suspension block:
This method is more intuitive. As an added bonus, it also allows the SMP implementation of
vTaskSuspendAll()
to be simplified (as we can assume thevTaskSuspendAll()
is now never called in a critical section). As such, an extra assert has been added tovTaskSuspendAll()
to ensure that it is never called in a critical section.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.