changeset 14851:5d879715aab6

8004318: JEP-171: Support Unsafe fences intrinsics Summary: Add three memory-ordering intrinsics to the sun.misc.Unsafe class. Reviewed-by: twisti, kvn Contributed-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
author kvn
date Tue, 18 Dec 2012 17:47:50 -0800
parents 793df625513b
children d513c47448f4
files jdk/src/share/classes/sun/misc/Unsafe.java
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/misc/Unsafe.java	Thu Dec 13 09:05:35 2012 -0800
+++ b/jdk/src/share/classes/sun/misc/Unsafe.java	Tue Dec 18 17:47:50 2012 -0800
@@ -1008,4 +1008,23 @@
      *         if the load average is unobtainable.
      */
     public native int getLoadAverage(double[] loadavg, int nelems);
+
+    /**
+     * Ensures lack of reordering of loads before the fence
+     * with loads or stores after the fence.
+     */
+    public native void loadFence();
+
+    /**
+     * Ensures lack of reordering of stores before the fence
+     * with loads or stores after the fence.
+     */
+    public native void storeFence();
+
+    /**
+     * Ensures lack of reordering of loads or stores before the fence
+     * with loads or stores after the fence.
+     */
+    public native void fullFence();
+
 }