Top


定義場所(file name)

jdk/src/share/classes/java/util/concurrent/locks/LockSupport.java

説明(description)

    /**
     * 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.
     */

名前(function name)

    public static void park() {

本体部(body)

  {- -------------------------------------------
  (1) sun.misc.Unsafe.park() を呼び出すだけ.
      ---------------------------------------- -}

            unsafe.park(false, 0L);
        }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.