src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java

Print this page

        

*** 37,46 **** --- 37,47 ---- import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.concurrent.TimeUnit; + import jdk.internal.vm.annotation.ReservedStackAccess; /** * Provides a framework for implementing blocking locks and related * synchronizers (semaphores, events, etc) that rely on * first-in-first-out (FIFO) wait queues. This class is designed to
*** 884,893 **** --- 885,895 ---- * * @param node the node * @param arg the acquire argument * @return {@code true} if interrupted while waiting */ + @ReservedStackAccess final boolean acquireQueued(final Node node, int arg) { try { boolean interrupted = false; for (;;) { final Node p = node.predecessor();
*** 1216,1225 **** --- 1218,1228 ---- * * @param arg the acquire argument. This value is conveyed to * {@link #tryAcquire} but is otherwise uninterpreted and * can represent anything you like. */ + @ReservedStackAccess public final void acquire(int arg) { if (!tryAcquire(arg) && acquireQueued(addWaiter(Node.EXCLUSIVE), arg)) selfInterrupt(); }
*** 1279,1288 **** --- 1282,1292 ---- * @param arg the release argument. This value is conveyed to * {@link #tryRelease} but is otherwise uninterpreted and * can represent anything you like. * @return the value returned from {@link #tryRelease} */ + @ReservedStackAccess public final boolean release(int arg) { if (tryRelease(arg)) { Node h = head; if (h != null && h.waitStatus != 0) unparkSuccessor(h);
*** 1359,1368 **** --- 1363,1373 ---- * @param arg the release argument. This value is conveyed to * {@link #tryReleaseShared} but is otherwise uninterpreted * and can represent anything you like. * @return the value returned from {@link #tryReleaseShared} */ + @ReservedStackAccess public final boolean releaseShared(int arg) { if (tryReleaseShared(arg)) { doReleaseShared(); return true; }