Skip to content

[Feature Request] Add API to get task base priority. #811

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

Closed
Spamfast opened this issue Sep 26, 2023 · 2 comments
Closed

[Feature Request] Add API to get task base priority. #811

Spamfast opened this issue Sep 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Spamfast
Copy link

Spamfast commented Sep 26, 2023

We use FreeRTOS a lot but come up against a snag when implementing temporary task priority boosting functionality.

The problem is that when mutexes are enabled in FreeRTOSConfig.h the value set by vTaskPrioritySet() is the base priority but the value returned by uxTaskPriorityGet() is the dynamic priority which may not be the same if the task currently owns a mutex that is waited on by a higher priority thread. So a task can't get its base priority, change it for a while and then restore it.

We work around this using vTaskGetInfo() to implement a uxTaskBasePriorityGet() but that is very inefficient.

It would be far better if the functionality were implemented in task.c and exposed in task.h.

@Spamfast Spamfast added the enhancement New feature or request label Sep 26, 2023
@chinglee-iot
Copy link
Member

Thank you for the suggestion. We would discuss about this API and later reply in this thread.

@kar-rahul-aws
Copy link
Member

Closing the issue, since the fix has been merged in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants