Skip to content

Fix eTaskGetState for pending ready tasks #577

New issue

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

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

Already on GitHub? # to your account

Closed

Conversation

Dazza0
Copy link
Contributor

@Dazza0 Dazza0 commented Oct 17, 2022

Fix eTaskGetState for pending ready tasks

Description

The description of the eReady enum is inclusive of tasks that are pending ready

    eReady,       /* The task being queried is in a ready or pending ready list. */

However, the current implementation of the eTaskGetState function only checks a task's state list item, thus will return a non-eReady state for tasks that are pending ready.

Test Steps

  1. From a main task, create a task_A.
  2. task_A blocks/suspends itself
  3. Main task calls vTaskSuspendAll()
  4. Main task triggers an ISR. The ISR unblocks task_A
  5. Main task then calls eTaskGetState on task_A which returns eBlocked/eSuspended even though task_A has been unblocked by the ISR.

Notes:

  • We discovered this issue through one of our kernel unit tests. I can post the test source code here if that helps
  • The SMP branch should also have the same issue. But I can raise a PR for the SMP branch once the fix for the mainline branch has been finalized.

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.

@Dazza0 Dazza0 requested a review from a team as a code owner October 17, 2022 06:57
This commit fixes eTaskGetState so that eReady is returned for pending ready
tasks.
@Dazza0 Dazza0 force-pushed the bugfix/eTaskGetState_pending_ready_tasks branch from 979827a to 0d374aa Compare October 17, 2022 07:03
This was linked to issues Mar 25, 2023
Closed
Closed
Closed
@Mancent Mancent linked an issue May 21, 2023 that may be closed by this pull request
@aggarg
Copy link
Member

aggarg commented May 25, 2023

Closing in favor of this one - #679

@aggarg aggarg closed this May 25, 2023
@Dazza0 Dazza0 deleted the bugfix/eTaskGetState_pending_ready_tasks branch February 1, 2024 19:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

> - [ ] ``` H G M https://docs.github.com/articles/keeping-your-account-and-data-secure/
3 participants