Name
AbstractQueuedSynchronizer
Synopsis
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 ...
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.