Repository navigation
[BUGFIX] Protect from data races when loading and staging models - #691
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Model and cabinet loads can overlap with audio processing. The cabinet loader previously published the primary processor, right-channel copy, and WAV gain flag separately. When switching between mono and stereo cabinets, the audio thread could take those values from different loads and end up with a mono cabinet missing its right-channel processor.
Group the cabinet processors and WAV flag into one object, and use a shared mutex to publish and consume staged model and cabinet changes. At the start of each block, the audio thread tries to acquire the mutex. If staging is busy, playback continues with the current processors and retries on the next block.
Adds a stress test where models are swapped a lot.
Resolves #647
PR Checklist
format.bash?