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

Cherry picks "Use LazyThreadSafteyMode.PUBLICATION instead of NONE (#433)" for v0.1.7 release #442

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

alancai98
Copy link
Member

LazyThreadSafetyMode.NONE literally means that accessing
the lazy value from multiple threads can cause an NPE.

Unfortunately, we assumed NONE would be implemented such
that a lazy value could be initialized by multiple
threads without throwing an NPE, with race conditions
only possibly occurring inside the initializer block.
However, that is actually the behavior is for
LazyThreadSafeteyMode.PUBLICATION.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

(cherry picked from commit eef183c)

This will be for the v0.1.7 release.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

LazyThreadSafetyMode.NONE literally means that accessing
the lazy value from multiple threads can cause an NPE.

Unfortunately, we assumed NONE would be implemented such
that a lazy value could be initialized by multiple
threads without throwing an NPE, with race conditions
only possibly occurring inside the initializer block.
However, that is actually the behavior is for
LazyThreadSafeteyMode.PUBLICATION.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

(cherry picked from commit eef183c)
@alancai98 alancai98 self-assigned this Sep 13, 2021
@alancai98 alancai98 merged commit 41d288f into v0.1.7 Sep 13, 2021
@alancai98 alancai98 deleted the v0.1.7-cp-lazy-pub-mode branch September 13, 2021 22:58
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