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

Atomic Use For "suspended" #20

Open
Rincewind34 opened this issue Jan 21, 2022 · 2 comments
Open

Atomic Use For "suspended" #20

Rincewind34 opened this issue Jan 21, 2022 · 2 comments

Comments

@Rincewind34
Copy link

I think the bool suspended in LevelMeterSource would make a great use of an atomic boolean. This way (and I think it is intended that way?) the UI would be able to suspend a meter source since it nows when it is not showing the level meter. The audio thread doesn't even have to call measureBlock if it wants to suspend the level meter.

Let me know what you think / if I should create a pull request.

@ffAudio
Copy link
Owner

ffAudio commented Jan 21, 2022

You are right, it should be atomic. I am just thinking about it though, maybe it shouldn't be a flag but a ref counter how many UI objects are looking at it. There could be any number of LevelMeters looking at it and if one is destroyed it must not reset the flag if other meters still look at it.
I will add some counter...
Thank you for the suggestion.

@Rincewind34
Copy link
Author

On a related note: the newDataFlag should also become atomic

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

No branches or pull requests

2 participants