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

removed unnecessary read lock in SpongeScheduler #3832

Merged
merged 1 commit into from Apr 1, 2023
Merged

removed unnecessary read lock in SpongeScheduler #3832

merged 1 commit into from Apr 1, 2023

Conversation

sunmisc
Copy link
Contributor

@sunmisc sunmisc commented Mar 6, 2023

synchronization block (read-only) is not needed for ConcurrentHashMap

to all this, the lock there has no meaning on reads, without a write lock (it is not there)

a very unpleasant bug can also turn out, this is when the uuid of the prng tasks will match, then the previous task will simply be removed from the map) this is a very rare case, but in theory it can happen

might be worth looking at the existing api - java.util.concurrent.ScheduledExecutorService

@sunmisc sunmisc changed the title removed unnecessary blocking removed unnecessary read lock in SpongeScheduler Mar 6, 2023
@ImMorpheus ImMorpheus merged commit a362f63 into SpongePowered:api-8 Apr 1, 2023
2 checks passed
@ImMorpheus
Copy link
Contributor

Thanks!

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.

None yet

3 participants