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

Make EmojiManager's initialization methods synchronized #365

Merged
merged 1 commit into from
May 30, 2019
Merged

Make EmojiManager's initialization methods synchronized #365

merged 1 commit into from
May 30, 2019

Conversation

rubengees
Copy link
Collaborator

@rubengees rubengees commented May 30, 2019

These methods are all operating on the static INSTANCE field and are modifying it, creating race conditions. While in practice this should never happen (install should be called synchronously in onCreate), I have a specific use case which requires synchronization: Async installation. If not synchronized, a call could happen directly after install, throwing an Exception, because the installation is not done yet.

@rubengees rubengees requested review from mario and vanniktech May 30, 2019 11:42
vanniktech
vanniktech previously approved these changes May 30, 2019
@rubengees rubengees requested a review from vanniktech May 30, 2019 18:34
@rubengees
Copy link
Collaborator Author

Sorry, for the noise @vanniktech, I had problems getting the static code analysis tools to accept these changes 😁

@mario
Copy link
Collaborator

mario commented May 30, 2019

Looks decent :D

Copy link
Owner

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good! Thanks for making that change

@vanniktech vanniktech changed the title Make singleton methods synchronized Make EmojiManager's initialization methods synchronized May 30, 2019
@vanniktech vanniktech merged commit 17b1e8d into vanniktech:master May 30, 2019
@rubengees rubengees deleted the synchronized branch May 30, 2019 21:47
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.

3 participants