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

thread safety changes for tweener class #885

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

eksime
Copy link
Contributor

@eksime eksime commented May 26, 2023

Discord Discussion

Breaking change: no

This is an attempt to fix #812 - mostly by converting the main Dictionary object used by the tweener class to a ConcurrentDictionary and adding locks to inner list access.

It also swaps out the implementations of toadd/toremove to ConcurrentQueue instead of list, as it's a more natural fit for the usecase.

There's also some minor cleanup of unused variables and formatting.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 8 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@eksime
Copy link
Contributor Author

eksime commented May 27, 2023

To expand on this - the tweener code is quite messy, and relies on a lot of reflection and boxing operations. In the future, if it's something you would be open to, I'd quite like to tackle reimplementing the core of it to make better use of generics for non-boxing operations on tween values & attaching the tweens to their targets using ConditionalWeakTables so that they don't prevent objects getting collected.

@dlamkins dlamkins added bug Something isn't working or doesn't work as expected. cleanup labels May 27, 2023
@dlamkins dlamkins merged commit c8201e7 into blish-hud:dev Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or doesn't work as expected. cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal on tweener (race condition)
2 participants