@Test public void testGetFirstQueuedThread() { final Mutex sync = new Mutex(); assertNull(sync.getFirstQueuedThread()); sync.acquire(); Thread t1 = newStartedThread(new InterruptedSyncRunnable(sync)); waitForQueuedThread(sync, t1); assertEquals(t1, sync.getFirstQueuedThread()); Thread t2 = newStartedThread(new InterruptibleSyncRunnable(sync)); waitForQueuedThread(sync, t2); assertEquals(t1, sync.getFirstQueuedThread()); t1.interrupt(); awaitTermination(t1); assertEquals(t2, sync.getFirstQueuedThread()); sync.release(); awaitTermination(t2); assertNull(sync.getFirstQueuedThread()); }
public final Thread getFirstQueuedThread() { return (head == tail) ? null : fullGetFirstQueuedThread(); }
AbstractQueuedSynchronizer extends AbstractOwnableSynchronizer implements java.io.Serializable { public final Thread getFirstQueuedThread() { return (head == tail) ? null : fullGetFirstQueuedThread(); } }
AbstractQueuedSynchronizer extends AbstractOwnableSynchronizer implements java.io.Serializable { public final Thread getFirstQueuedThread() { return (head == tail) ? null : fullGetFirstQueuedThread(); } protected  AbstractQueuedSynchronizer(); }
AbstractQueuedSynchronizer extends AbstractOwnableSynchronizer implements java.io.Serializable { public final Thread getFirstQueuedThread() { return (head == tail) ? null : fullGetFirstQueuedThread(); } protected  AbstractQueuedSynchronizer(); final void acquire(long arg); final void acquireInterruptibly(long arg); final boolean tryAcquireNanos(long arg, long nanosTimeout); final boolean release(long arg); final void acquireShared(long arg); final void acquireSharedInterruptibly(long arg); final boolean tryAcquireSharedNanos(long arg, long nanosTimeout); final boolean releaseShared(long arg); final boolean hasQueuedThreads(); final boolean hasContended(); final Thread getFirstQueuedThread(); final boolean isQueued(Thread thread); final boolean hasQueuedPredecessors(); final int getQueueLength(); final Collection<Thread> getQueuedThreads(); final Collection<Thread> getExclusiveQueuedThreads(); final Collection<Thread> getSharedQueuedThreads(); String toString(); final boolean owns(ConditionObject condition); final boolean hasWaiters(ConditionObject condition); final int getWaitQueueLength(ConditionObject condition); final Collection<Thread> getWaitingThreads(ConditionObject condition); }
AbstractQueuedSynchronizer extends AbstractOwnableSynchronizer implements java.io.Serializable { public final Thread getFirstQueuedThread() { return (head == tail) ? null : fullGetFirstQueuedThread(); } protected  AbstractQueuedSynchronizer(); final void acquire(long arg); final void acquireInterruptibly(long arg); final boolean tryAcquireNanos(long arg, long nanosTimeout); final boolean release(long arg); final void acquireShared(long arg); final void acquireSharedInterruptibly(long arg); final boolean tryAcquireSharedNanos(long arg, long nanosTimeout); final boolean releaseShared(long arg); final boolean hasQueuedThreads(); final boolean hasContended(); final Thread getFirstQueuedThread(); final boolean isQueued(Thread thread); final boolean hasQueuedPredecessors(); final int getQueueLength(); final Collection<Thread> getQueuedThreads(); final Collection<Thread> getExclusiveQueuedThreads(); final Collection<Thread> getSharedQueuedThreads(); String toString(); final boolean owns(ConditionObject condition); final boolean hasWaiters(ConditionObject condition); final int getWaitQueueLength(ConditionObject condition); final Collection<Thread> getWaitingThreads(ConditionObject condition);  }