src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java

Print this page
rev 12972 : 8140606: Update library code to use internal Unsafe
Reviewed-by: duke

@@ -281,11 +281,11 @@
             boolean isCancelled() {
                 return match == this;
             }
 
             // Unsafe mechanics
-            private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+            private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe();
             private static final long MATCH;
             private static final long NEXT;
 
             static {
                 try {

@@ -507,11 +507,11 @@
                     p = n;
             }
         }
 
         // Unsafe mechanics
-        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+        private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe();
         private static final long HEAD;
         static {
             try {
                 HEAD = U.objectFieldOffset
                     (TransferStack.class.getDeclaredField("head"));

@@ -573,11 +573,11 @@
             boolean isOffList() {
                 return next == this;
             }
 
             // Unsafe mechanics
-            private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+            private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe();
             private static final long ITEM;
             private static final long NEXT;
 
             static {
                 try {

@@ -815,11 +815,11 @@
                 } else if (casCleanMe(null, pred))
                     return;          // Postpone cleaning s
             }
         }
 
-        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+        private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe();
         private static final long HEAD;
         private static final long TAIL;
         private static final long CLEANME;
         static {
             try {