# HG changeset patch # User dl # Date 1497370408 25200 # Node ID 9e0c80381e32f84f8c8047e98798e77b80dc3204 # Parent 87a2aeead10e08e080f8a579bd268a9ba6e61a17 8181104: Fix specs for updateAndGet and related methods Reviewed-by: martin, psandoz, dholmes, chegar diff -r 87a2aeead10e -r 9e0c80381e32 jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java Tue Jun 13 13:31:32 2017 +0100 +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java Tue Jun 13 09:13:28 2017 -0700 @@ -110,6 +110,20 @@ * boolean r = avh.compareAndSet(sa, 10, "expected", "new"); * } * + *

Access modes control atomicity and consistency properties. + * Plain read ({@code get}) and write ({@code set}) + * accesses are guaranteed to be bitwise atomic only for references + * and for primitive values of at most 32 bits, and impose no observable + * ordering constraints with respect to threads other than the + * executing thread. Opaque operations are bitwise atomic and + * coherently ordered with respect to accesses to the same variable. + * In addition to obeying Opaque properties, Acquire mode + * reads and their subsequent accesses are ordered after matching + * Release mode writes and their previous accesses. In + * addition to obeying Acquire and Release properties, all + * Volatile operations are totally ordered with respect to + * each other. + * *

Access modes are grouped into the following categories: *