-
Notifications
You must be signed in to change notification settings - Fork 281
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
Issue #2597: Add thread safety to duplicate name hash #2632
Issue #2597: Add thread safety to duplicate name hash #2632
Conversation
I should add I was unable to replicate the original issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two comments on variable name oddities
Your discretion on 0.48, especially given MegaMek/mekhq#2412 |
I have never been able to reproduce this, so it may be worth seeing if one of the bug reporters can test a snapshot of this. |
The duplicate name protection code used a
Hashtable
which is thread safe, however, performing multiple operations is not atomic. This switches to use a lock to synchronize access to duplicate name generation. This also adds a lock to synchronize setting the short and display names. This makes both operations atomic and idempotent.I don't think this is necessary for 0.48.