diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java index 9e2533f071e..e46805538d4 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java @@ -110,6 +110,20 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; * 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: *