Skip to content

Commit d8fe21b

Browse files
committed
Java: Update qhelp as per review.
1 parent 17b4276 commit d8fe21b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

java/ql/src/Likely Bugs/Concurrency/DoubleCheckedLockingShared.qhelp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ variable can be used to avoid reading the field more times than neccessary.
6868

6969
<p>
7070
As a final note, it is possible to use double-checked locking correctly without
71-
<code>volatile</code> if the constructed object is immutable in the sense that
72-
all its fields are declared <code>final</code> and the double-checked field is
73-
read exactly once outside the synchronized block.
71+
<code>volatile</code> if the object you construct is immutable. That is, the
72+
object declares all fields as <code>final</code>, and the double-checked field
73+
is read exactly once outside the synchronized block.
7474
</p>
7575
<p>
7676
Given that all fields in <code>MyImmutableObject</code> are declared
@@ -101,9 +101,11 @@ Java Language Specification:
101101
Wikipedia: <a href="https://en.wikipedia.org/wiki/Double-checked_locking">Double-checked locking</a>.
102102
</li>
103103
<li>
104+
Aleksey Shipilëv:
104105
<a href="https://shipilev.net/blog/2014/safe-public-construction/">Safe Publication and Safe Initialization in Java</a>.
105106
</li>
106107
<li>
108+
Aleksey Shipilëv:
107109
<a href="https://shipilev.net/blog/2016/close-encounters-of-jmm-kind/">Close Encounters of The Java Memory Model Kind</a>.
108110
</li>
109111

0 commit comments

Comments
 (0)