Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unpaired critical section in vTaskDelete for readability #958

Merged

Conversation

chinglee-iot
Copy link
Member

@chinglee-iot chinglee-iot commented Jan 19, 2024

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:

  • Update the implementation to fix the unpaired critical section.
  • Move the prvDeleteTCB out of the critical section

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

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.

* Update the implementation for readability
* Move prvDeleteTCB out of critical section for SMP
@chinglee-iot chinglee-iot requested a review from a team as a code owner January 19, 2024 08:54
@chinglee-iot
Copy link
Member Author

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.

kar-rahul-aws
kar-rahul-aws previously approved these changes Jan 22, 2024
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
aggarg
aggarg previously approved these changes Jan 23, 2024
tasks.c Show resolved Hide resolved
ActoryOu
ActoryOu previously approved these changes Jan 23, 2024
@chinglee-iot chinglee-iot dismissed stale reviews from ActoryOu and aggarg via 216ea39 January 23, 2024 08:34
Copy link

sonarcloud bot commented Jan 23, 2024

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

@chinglee-iot chinglee-iot merged commit cf2366c into FreeRTOS:main Jan 23, 2024
14 checks passed
@chinglee-iot chinglee-iot deleted the update-vTaskDelete-readibility branch January 23, 2024 09:02
feilipu added a commit to feilipu/FreeRTOS-Kernel that referenced this pull request Jan 23, 2024
Update unpaired critical section in vTaskDelete for readability (FreeRTOS#958)
laroche pushed a commit to laroche/FreeRTOS-Kernel that referenced this pull request Apr 18, 2024
* Add IPv6 Demo (FreeRTOS#937)

* Add demo changes

* Update kernel and library paths

* Update main.c

* Run uncrustify

* Fix spell checker

* CI check file headers update

* Add IPv6/v4 UDP echo server with zero copy/non-zero copy versions

* Add VS proj file changes to include the UDP echo sample code

* readme update

---------

Co-authored-by: Tony Josi <tonyjosi@amazon.com>

* Update Backward Compatibility Flag (FreeRTOS#954)

* Update Backward Compatibility Flag

* Update FreeRTOS_GetUDPPayloadBuffer_ByIPType

* Update FreeRTOS_IPStart to FreeRTOS_IPInit_Multi

* Update Application APIs

* Remove ipconfigCOMPATIBLE_WITH_SINGLE

* Update Static Lib files (FreeRTOS#956)

* Update Static Lib files

* making vApplicationIPNetworkEventHook backward compatible in demos

* Update CI check file headers

---------

Co-authored-by: Tony Josi <tonyjosi@amazon.com>

* Add WinPCap NetworkInterface Changes (FreeRTOS#958)

* Update winpcap network interface

* Run uncrustify

* Update function to include NetworkInterface_t parameters

* Adding compatibility for xApplicationDNSQueryHook with latest dev branch for old demos (FreeRTOS#957)

* adding compatibility for xApplicationDNSQueryHook with latest dev branch

* adding tcp echo server source

* removing unused sub demos

* fix build issues (FreeRTOS#969)

* Update demo to latest +TCP dev/IPv6_integration (FreeRTOS#978)

* remove macro namings

* rename sin_addr to sin_address.ulIP_IPv4 for ipv6 demo

* replace in6addr_any with FreeRTOS_in6addr_any

* replace mainCREATE_UDP_ECHO_SERVER_TASK with mainCREATE_UDP_ECHO_TASKS_SINGLE

* handle removal of sin_addr macro to sin_address.ulIP_IPv4

* updating +TCP repo to latest dev/IPv6_integration

* minor update to more clear code

* more sin_addr to sin_address.ulIP_IPv4 replacements

* fix makefiles for qemu and posix demos

* review feedback changes

* Update FreeRTOS-Plus-TCP for RC2

* Change from PR (FreeRTOS#994)

* Update FreeRTOS-Plus-TCP for RC2

* Update copyright

* Ignore WinPCap for files header check failure.

* Update checker

* Update manifest

* Point manifest to latest commit

* Fix Spell-checker

* Update doxygen

* Update xApplicationDHCPHook for backward compatibility  (FreeRTOS#999)

* Update xApplicationDHCPHook for backward compatability

* Update IPv6

* Update VisualStudio Static Project files

* Update pxEndPoint error (FreeRTOS#1002)

* Update IPv6 demo ReadMe (FreeRTOS#1004)

* Update ReadMe

* Update setup requirement

* Update UDP demo info

* Update comment

* TCP demo changes post build separation (FreeRTOS#1011)

* adding sin_family to dest adddr for FreeRTOS_sendto

* updating FreeRTOS_bind to input sin_family post build separation changes

* updating FreeRTOS_connect to input sin_family post build separation changes

* minor fix

* updating copyright year

* updating file headers

* updating +TCP submodule

* updating file headers

* updating file headers

* updating manifest file to have latest +TCP submodule hash

* Fix issue with posix demo while running with ipconfigIPv4_BACKWARD_COMPATIBLE enabled for +TCP stack (FreeRTOS#1027)

* Update the submodule pointer to IPv6 main

* Update manifest with latest TCP commit

* Update file checker exception

* Ignore Visual studio project file from file header checker

---------

Co-authored-by: Tony Josi <tonyjosi@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants