-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
I don't quite understand why getAdapter()
method is thread safe?
#1509
Comments
That just means that work is duplicated when an adapter is requested for the first time concurrently. Creating the same adapter multiple times should always produce the same result. |
@JakeWharton I'd try to explain my current understanding.
am i right? is there any mistake in my understanding? |
As already mentioned above in #1509 (comment) even if a The previous Gson code using I am closing this issue because I think this has been answered. If you have further questions, feel free to ask. |
quote a part of
getAdapter()
method:typeTokenCache.get
andtypeTokenCache.put
are not an atomic pair. So why this method, as well asfromJson()
s andtoJson()
s referencing it, is thread safe?The text was updated successfully, but these errors were encountered: