Java: Update qhelp as per review.

This commit is contained in:
Anders Schack-Mulligen
2019-01-18 11:42:34 +01:00
parent 17b4276699
commit d8fe21be7e

View File

@@ -68,9 +68,9 @@ variable can be used to avoid reading the field more times than neccessary.
<p>
As a final note, it is possible to use double-checked locking correctly without
<code>volatile</code> if the constructed object is immutable in the sense that
all its fields are declared <code>final</code> and the double-checked field is
read exactly once outside the synchronized block.
<code>volatile</code> if the object you construct is immutable. That is, the
object declares all fields as <code>final</code>, and the double-checked field
is read exactly once outside the synchronized block.
</p>
<p>
Given that all fields in <code>MyImmutableObject</code> are declared
@@ -101,9 +101,11 @@ Java Language Specification:
Wikipedia: <a href="https://en.wikipedia.org/wiki/Double-checked_locking">Double-checked locking</a>.
</li>
<li>
Aleksey Shipilëv:
<a href="https://shipilev.net/blog/2014/safe-public-construction/">Safe Publication and Safe Initialization in Java</a>.
</li>
<li>
Aleksey Shipilëv:
<a href="https://shipilev.net/blog/2016/close-encounters-of-jmm-kind/">Close Encounters of The Java Memory Model Kind</a>.
</li>