jdk/src/java.base/share/classes/sun/misc/Unsafe.java
changeset 29715 ca3f43a932cf
parent 29388 c821b03af80a
child 30338 957ee8b5a33a
--- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java	Tue Mar 10 14:23:03 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java	Wed Mar 04 17:35:40 2015 -0800
@@ -631,6 +631,10 @@
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
      * @return {@code true} if successful
      */
     public final native boolean compareAndSwapObject(Object o, long offset,
@@ -640,6 +644,10 @@
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
      * @return {@code true} if successful
      */
     public final native boolean compareAndSwapInt(Object o, long offset,
@@ -649,6 +657,10 @@
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
      * @return {@code true} if successful
      */
     public final native boolean compareAndSwapLong(Object o, long offset,