src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
Print this page
rev 12972 : 8140606: Update library code to use internal Unsafe
Reviewed-by: duke
@@ -522,11 +522,11 @@
/** CASes next field. */
final boolean compareAndSetNext(Node expect, Node update) {
return U.compareAndSwapObject(this, NEXT, expect, update);
}
- 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 NEXT;
static final long PREV;
private static final long THREAD;
private static final long WAITSTATUS;
static {
@@ -2283,11 +2283,11 @@
* efficient and useful otherwise. So, as the lesser of evils, we
* natively implement using hotspot intrinsics API. And while we
* are at it, we do the same for other CASable fields (which could
* otherwise be done with atomic field updaters).
*/
- 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 STATE;
private static final long HEAD;
private static final long TAIL;
static {