FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.52k stars 1.05k forks source link

Update unpaired critical section in vTaskDelete for readability #958

Closed chinglee-iot closed 5 months ago

chinglee-iot commented 6 months ago

Update unpaired critical section in vTaskDelete for readability

Description

The implementation in vTaskDelete increase cognitive load as the critical section is unpaired due to single core and SMP implementation.

In this PR:

Test Steps

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.

chinglee-iot commented 6 months ago

Unit test is updated in this PR and tested locally.

Failed test cases:

/mnt/c/msys64/home/chinglee/kernel/unit-test/FreeRTOS/FreeRTOS/Test/CMock/smp/config_assert/config_assert_utest.c:381:test_vTaskDelete_assert_scheduler_suspended_eq_1:FAIL:Function vFakePortExitCriticalSection. Called more times than expected.

/mnt/c/msys64/home/chinglee/kernel/unit-test/FreeRTOS/FreeRTOS/Test/CMock/smp/multiple_priorities_no_timeslice_mock/covg_multiple_priorities_no_timeslice_mock_utest.c:562:test_coverage_vTaskDelete_task_not_running:FAIL:Function vFakePortEnterCriticalSection. Called more times than expected.

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud