This class may be removed in the future. Consider the replacements in JEP 193 'Variable Handles': http://openjdk.java.net/jeps/193
/** * Disables the current thread for thread scheduling purposes unless the * permit is available. * * <p>If the permit is available then it is consumed and the call * returns immediately; otherwise the current thread becomes disabled * for thread scheduling purposes and lies dormant until one of three * things happens: * * <ul> * * <li>Some other thread invokes {@link #unpark unpark} with the * current thread as the target; or * * <li>Some other thread {@linkplain Thread#interrupt interrupts} * the current thread; or * * <li>The call spuriously (that is, for no reason) returns. * </ul> * * <p>This method does <em>not</em> report which of these caused the * method to return. Callers should re-check the conditions which caused * the thread to park in the first place. Callers may also determine, * for example, the interrupt status of the thread upon return. */ public static void park() { unsafe.park(false, 0L); }
unsafe.park(false, nanos);
unsafe.park(true, deadline);
w.parker = wt; if (ctl == currentCtl) U.park(false, parkTime); w.parker = null; U.putObject(wt, PARKBLOCKER, null);
w.parker = wt; if (ctl == currentCtl) U.park(false, parkTime); w.parker = null; U.putObject(wt, PARKBLOCKER, null);
w.parker = wt; if (ctl == currentCtl) U.park(false, parkTime); w.parker = null; U.putObject(wt, PARKBLOCKER, null);
w.parker = wt; if (ctl == currentCtl) U.park(false, parkTime); w.parker = null; U.putObject(wt, PARKBLOCKER, null);
w.parker = wt; if (ctl == currentCtl) U.park(false, SHRINK_RATE); w.parker = null; U.putObject(wt, PARKBLOCKER, null);
Thread t = Thread.currentThread(); setBlocker(t, blocker); unsafe.park(false, 0L); setBlocker(t, null);
Thread t = Thread.currentThread(); setBlocker(t, blocker); unsafe.park(true, deadline); setBlocker(t, null);
Thread t = Thread.currentThread(); setBlocker(t, blocker); unsafe.park(false, nanos); setBlocker(t, null);
p.parked = t; if (slot == p) U.park(false, ns); p.parked = null; U.putObject(t, BLOCKER, null);
U.park(false, 0L); w.parker = null; U.putObject(wt, PARKBLOCKER, null);
U.park(false, 0L); // block w.parker = null; U.putObject(wt, PARKBLOCKER, null);
U.park(false, 0L); // block w.parker = null; U.putObject(wt, PARKBLOCKER, null);
U.park(false, 0L); // block w.parker = null; U.putObject(wt, PARKBLOCKER, null);
U.park(false, 0L); w.parker = null; U.putObject(wt, PARKBLOCKER, null);
U.park(false, ns); p.parked = null; U.putObject(t, BLOCKER, null);
U.park(false, parkTime); // must recheck before park w.parker = null; U.putObject(wt, PARKBLOCKER, null);
public void run() { while (true) { unsafe.park(false, interval); TIMESTAMP += step; } } }, "BTrace Sampled Timer");