public abstract class AbstractQueuedLongSynchronizer extends AbstractOwnableSynchronizer implements Serializable
AbstractQueuedSynchronizer
in
which synchronization state is maintained as a long
.
This class has exactly the same structure, properties, and methods
as AbstractQueuedSynchronizer
with the exception
that all state-related parameters and results are defined
as long
rather than int
. This class
may be useful when creating synchronizers such as
multilevel locks and barriers that require
64 bits of state.
See AbstractQueuedSynchronizer
for usage
notes and examples.
Modifier and Type | Class | Description |
---|---|---|
class |
AbstractQueuedLongSynchronizer.ConditionObject |
Condition implementation for a
AbstractQueuedLongSynchronizer serving as the basis of a Lock implementation. |
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractQueuedLongSynchronizer() |
Creates a new
AbstractQueuedLongSynchronizer instance
with initial synchronization state of zero. |
Modifier and Type | Method | Description |
---|---|---|
void |
acquire(long arg) |
Acquires in exclusive mode, ignoring interrupts.
|
void |
acquireInterruptibly(long arg) |
Acquires in exclusive mode, aborting if interrupted.
|
void |
acquireShared(long arg) |
Acquires in shared mode, ignoring interrupts.
|
void |
acquireSharedInterruptibly(long arg) |
Acquires in shared mode, aborting if interrupted.
|
protected boolean |
compareAndSetState(long expect,
long update) |
Atomically sets synchronization state to the given updated
value if the current state value equals the expected value.
|
Collection<Thread> |
getExclusiveQueuedThreads() |
Returns a collection containing threads that may be waiting to
acquire in exclusive mode.
|
Thread |
getFirstQueuedThread() |
Returns the first (longest-waiting) thread in the queue, or
null if no threads are currently queued. |
Collection<Thread> |
getQueuedThreads() |
Returns a collection containing threads that may be waiting to
acquire.
|
int |
getQueueLength() |
Returns an estimate of the number of threads waiting to
acquire.
|
Collection<Thread> |
getSharedQueuedThreads() |
Returns a collection containing threads that may be waiting to
acquire in shared mode.
|
protected long |
getState() |
Returns the current value of synchronization state.
|
Collection<Thread> |
|