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: race condition on mixer task handle #3914

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

raphaelcoeffic
Copy link
Member

PR #3451 moved the start of the mixer task to a point in time where the task scheduler is already started (UI task). Before that change, the mixer task would be created before and effectively started after the task scheduler started.

This introduces a race condition on mixerTaskId.rtos_handle, as the mixer scheduler might trigger before xTaskCreateStatic returns and the task handle is assigned.

This PR fixes the issue by delaying the start of the mixer scheduler until xTaskCreateStatic returned and the task handler has been properly assigned.

PR #3451 introduced a change that caused the mixer task to be started out of the UI task, which introduces a race condition `mixerTaskId.rtos_handle`, as the mixer scheduler might trigger before `xTaskCreateStatic` returns and the task handle is assigned.

This PR fixes the issue by delaying the start of the mixer scheduler until `xTaskCreateStatic` returned and the task handler has been properly assigned.
@raphaelcoeffic
Copy link
Member Author

raphaelcoeffic commented Aug 7, 2023

Tested on:

  • X12S
  • TX16S
  • T20

@raphaelcoeffic raphaelcoeffic merged commit 017ac82 into main Aug 7, 2023
36 checks passed
@raphaelcoeffic raphaelcoeffic deleted the mixer-task-race-condition branch August 7, 2023 11:34
@pfeerick pfeerick added the bug/regression ↩️ A new version of EdgeTX broke something label Aug 7, 2023
@pfeerick pfeerick added this to the 2.10 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/regression ↩️ A new version of EdgeTX broke something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants