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

Fix missed yield in xTaskResumeFromISR #207

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

aggarg
Copy link
Member

@aggarg aggarg commented Oct 22, 2020

Description

If a higher priority task than the currently running task was resumed using xTaskResumeFromISR and the user chose to ignore the return value of xTaskResumeFromISR to initiate a context switch using portYIELD_FROM_ISR, we were not doing the context switch on the next run of the scheduler. This change fixes this by marking a yield as pending to ensure that the context switch is performed on the next run of the scheduler.

Related Issue

https://forums.freertos.org/t/issue-resuming-and-sending-a-message-to-a-task-from-an-isr-cortex-m4/10957/14

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

If a higher priority task than the currently running task was resumed
using xTaskResumeFromISR and the user chose to ignore the return value
of xTaskResumeFromISR to initiate a context switch using
portYIELD_FROM_ISR, we were not doing the context switch on the next run
of the scheduler. This change fixes this by marking a yield as pending
to ensure that the context switch is performed on the next run of the
scheduler.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@aggarg aggarg requested a review from RichardBarry October 22, 2020 23:56
@RichardBarry RichardBarry merged commit db62e30 into FreeRTOS:master Oct 23, 2020
@aggarg aggarg deleted the task_resume branch October 11, 2021 05:39
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.

2 participants