< prev index next >
src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java
Print this page
*** 139,149 ****
public class LockSupport {
private LockSupport() {} // Cannot be instantiated.
private static void setBlocker(Thread t, Object arg) {
// Even though volatile, hotspot doesn't need a write barrier here.
! U.putObject(t, PARKBLOCKER, arg);
}
/**
* Makes available the permit for the given thread, if it
* was not already available. If the thread was blocked on
--- 139,149 ----
public class LockSupport {
private LockSupport() {} // Cannot be instantiated.
private static void setBlocker(Thread t, Object arg) {
// Even though volatile, hotspot doesn't need a write barrier here.
! U.putReference(t, PARKBLOCKER, arg);
}
/**
* Makes available the permit for the given thread, if it
* was not already available. If the thread was blocked on
*** 289,299 ****
* @since 1.6
*/
public static Object getBlocker(Thread t) {
if (t == null)
throw new NullPointerException();
! return U.getObjectVolatile(t, PARKBLOCKER);
}
/**
* Disables the current thread for thread scheduling purposes unless the
* permit is available.
--- 289,299 ----
* @since 1.6
*/
public static Object getBlocker(Thread t) {
if (t == null)
throw new NullPointerException();
! return U.getReferenceVolatile(t, PARKBLOCKER);
}
/**
* Disables the current thread for thread scheduling purposes unless the
* permit is available.
< prev index next >