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

OboeTester: Fix race condition with setWorkload in Dynamic Workload Activity #2140

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

robertwu1
Copy link
Collaborator

@robertwu1 robertwu1 commented Jan 17, 2025

If the workload is set in the middle of onAudioReady(), the new workload can be used for the synth before audioStream->reportWorkload() is called for this workload.

The fix here is to use an atomic variable and the same workload throughout the function.

@robertwu1 robertwu1 requested a review from philburk January 17, 2025 00:44
Copy link
Collaborator

@philburk philburk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!
mNumWorkloadVoices is modified asynchronously by Java.

@robertwu1 robertwu1 merged commit 71d6185 into main Jan 17, 2025
3 checks passed
@robertwu1 robertwu1 deleted the robertwu/setworkloadracecondition branch January 17, 2025 18:27
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