March 2005
Beginner to intermediate
1254 pages
104h 21m
English
AbstractQueuedSynchronizer
This
abstract
class is a low-level utility. A concrete subclass can be used as a
helper class for implementing the Lock interface
or for implementing synchronizer utilities like the
CountDownLatch class of
java.util.concurrent. Subclasses must define
tryAcquire( ), tryRelease( ),
tryAcquireShared( ), tryReleaseShared(
), and isHeldExclusively.
Figure 16-104. java.util.concurrent.locks.AbstractQueuedSynchronizer
public abstract class AbstractQueuedSynchronizer implements Serializable { // Protected Constructors protected AbstractQueuedSynchronizer( ); // Nested Types public class ConditionObject implements Condition, Serializable; // Public Instance Methods public final void acquire(int arg); public final void acquireInterruptibly(int arg) throws InterruptedException; public final void acquireShared(int arg); public final void acquireSharedInterruptibly(int arg) throws InterruptedException; public final java.util.Collection<Thread> getExclusiveQueuedThreads( ); public final Thread getFirstQueuedThread( ); public final java.util.Collection<Thread> getQueuedThreads( ); public final int getQueueLength( ); public final java.util.Collection<Thread> getSharedQueuedThreads( ); public final java.util.Collection<Thread> getWaitingThreads(AbstractQueuedSynchronizer. ConditionObject condition); public final int getWaitQueueLength(AbstractQueuedSynchronizer.ConditionObject ...
Read now
Unlock full access