java.util.concurrent.locks
14 classes of the module java.base.
Load them with:
using {
"java.util.concurrent.locks"
}
AbstractOwnableSynchronizer#
abstract · extends Object · java.util.concurrent.locks.AbstractOwnableSynchronizer
Implements: Serializable
The methods and fields of Object are inherited.
AbstractQueuedLongSynchronizer#
abstract · extends AbstractOwnableSynchronizer · java.util.concurrent.locks.AbstractQueuedLongSynchronizer
Implements: Serializable
Methods
| Method | Ring call | Java overloads |
|---|---|---|
acquire | acquire(arg) | void acquire(long arg) |
acquireInterruptibly | acquireInterruptibly(arg) | void acquireInterruptibly(long arg) |
acquireShared | acquireShared(arg) | void acquireShared(long arg) |
acquireSharedInterruptibly | acquireSharedInterruptibly(arg) | void acquireSharedInterruptibly(long arg) |
getExclusiveQueuedThreads | getExclusiveQueuedThreads() | Collection getExclusiveQueuedThreads() |
getFirstQueuedThread | getFirstQueuedThread() | Thread getFirstQueuedThread() |
getQueuedThreads | getQueuedThreads() | Collection getQueuedThreads() |
getQueueLength | getQueueLength() | int getQueueLength() |
getSharedQueuedThreads | getSharedQueuedThreads() | Collection getSharedQueuedThreads() |
getWaitingThreads | getWaitingThreads(condition) | Collection getWaitingThreads(ConditionObject condition) |
getWaitQueueLength | getWaitQueueLength(condition) | int getWaitQueueLength(ConditionObject condition) |
hasContended | hasContended() | boolean hasContended() |
hasQueuedPredecessors | hasQueuedPredecessors() | boolean hasQueuedPredecessors() |
hasQueuedThreads | hasQueuedThreads() | boolean hasQueuedThreads() |
hasWaiters | hasWaiters(condition) | boolean hasWaiters(ConditionObject condition) |
isQueued | isQueued(thread) | boolean isQueued(Thread thread) |
owns | owns(condition) | boolean owns(ConditionObject condition) |
release | release(arg) | boolean release(long arg) |
releaseShared | releaseShared(arg) | boolean releaseShared(long arg) |
tryAcquireNanos | tryAcquireNanos(arg,nanosTimeout) | boolean tryAcquireNanos(long arg, long nanosTimeout) |
tryAcquireSharedNanos | tryAcquireSharedNanos(arg,nanosTimeout) | boolean tryAcquireSharedNanos(long arg, long nanosTimeout) |
The methods and fields of AbstractOwnableSynchronizer are inherited.
AbstractQueuedLongSynchronizerConditionObject#
class · extends Object · java.util.concurrent.locks.AbstractQueuedLongSynchronizer$ConditionObject
Implements: Condition, Serializable
Constructors
new AbstractQueuedLongSynchronizerConditionObject(AbstractQueuedLongSynchronizer p1) |
Ring: new AbstractQueuedLongSynchronizerConditionObject(args) uses the constructor with the fewest parameters (at least one); new AbstractQueuedLongSynchronizerConditionObject makes the object with the constructor without parameters; the others: (new AbstractQueuedLongSynchronizerConditionObject).@New([ :param = value ]) or .@New([v1,v2]).
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@await | @await([time,unit])@await([ :time = v, :unit = v ]) | boolean await(long time, TimeUnit unit) |
await | await() | void await() |
awaitNanos | awaitNanos(nanosTimeout) | long awaitNanos(long nanosTimeout) |
awaitUninterruptibly | awaitUninterruptibly() | void awaitUninterruptibly() |
awaitUntil | awaitUntil(deadline) | boolean awaitUntil(Date deadline) |
signal | signal() | void signal() |
signalAll | signalAll() | void signalAll() |
The methods and fields of Object are inherited.
AbstractQueuedSynchronizer#
abstract · extends AbstractOwnableSynchronizer · java.util.concurrent.locks.AbstractQueuedSynchronizer
Implements: Serializable
Methods
| Method | Ring call | Java overloads |
|---|---|---|
acquire | acquire(arg) | void acquire(int arg) |
acquireInterruptibly | acquireInterruptibly(arg) | void acquireInterruptibly(int arg) |
acquireShared | acquireShared(arg) | void acquireShared(int arg) |
acquireSharedInterruptibly | acquireSharedInterruptibly(arg) | void acquireSharedInterruptibly(int arg) |
getExclusiveQueuedThreads | getExclusiveQueuedThreads() | Collection getExclusiveQueuedThreads() |
getFirstQueuedThread | getFirstQueuedThread() | Thread getFirstQueuedThread() |
getQueuedThreads | getQueuedThreads() | Collection getQueuedThreads() |
getQueueLength | getQueueLength() | int getQueueLength() |
getSharedQueuedThreads | getSharedQueuedThreads() | Collection getSharedQueuedThreads() |
getWaitingThreads | getWaitingThreads(condition) | Collection getWaitingThreads(ConditionObject condition) |
getWaitQueueLength | getWaitQueueLength(condition) | int getWaitQueueLength(ConditionObject condition) |
hasContended | hasContended() | boolean hasContended() |
hasQueuedPredecessors | hasQueuedPredecessors() | boolean hasQueuedPredecessors() |
hasQueuedThreads | hasQueuedThreads() | boolean hasQueuedThreads() |
hasWaiters | hasWaiters(condition) | boolean hasWaiters(ConditionObject condition) |
isQueued | isQueued(thread) | boolean isQueued(Thread thread) |
owns | owns(condition) | boolean owns(ConditionObject condition) |
release | release(arg) | boolean release(int arg) |
releaseShared | releaseShared(arg) | boolean releaseShared(int arg) |
tryAcquireNanos | tryAcquireNanos(arg,nanosTimeout) | boolean tryAcquireNanos(int arg, long nanosTimeout) |
tryAcquireSharedNanos | tryAcquireSharedNanos(arg,nanosTimeout) | boolean tryAcquireSharedNanos(int arg, long nanosTimeout) |
The methods and fields of AbstractOwnableSynchronizer are inherited.
AbstractQueuedSynchronizerConditionObject#
class · extends Object · java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
Implements: Condition, Serializable
Constructors
new AbstractQueuedSynchronizerConditionObject(AbstractQueuedSynchronizer p1) |
Ring: new AbstractQueuedSynchronizerConditionObject(args) uses the constructor with the fewest parameters (at least one); new AbstractQueuedSynchronizerConditionObject makes the object with the constructor without parameters; the others: (new AbstractQueuedSynchronizerConditionObject).@New([ :param = value ]) or .@New([v1,v2]).
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@await | @await([time,unit])@await([ :time = v, :unit = v ]) | boolean await(long time, TimeUnit unit) |
await | await() | void await() |
awaitNanos | awaitNanos(nanosTimeout) | long awaitNanos(long nanosTimeout) |
awaitUninterruptibly | awaitUninterruptibly() | void awaitUninterruptibly() |
awaitUntil | awaitUntil(deadline) | boolean awaitUntil(Date deadline) |
signal | signal() | void signal() |
signalAll | signalAll() | void signalAll() |
The methods and fields of Object are inherited.
Condition#
interface · java.util.concurrent.locks.Condition
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@await | @await([time,unit])@await([ :time = v, :unit = v ]) | boolean await(long time, TimeUnit unit) |
await | await() | void await() |
awaitNanos | awaitNanos(nanosTimeout) | long awaitNanos(long nanosTimeout) |
awaitUninterruptibly | awaitUninterruptibly() | void awaitUninterruptibly() |
awaitUntil | awaitUntil(deadline) | boolean awaitUntil(Date deadline) |
signal | signal() | void signal() |
signalAll | signalAll() | void signalAll() |
Lock#
interface · java.util.concurrent.locks.Lock
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@tryLock | @tryLock([time,unit])@tryLock([ :time = v, :unit = v ]) | boolean tryLock(long time, TimeUnit unit) |
lock | lock() | void lock() |
lockInterruptibly | lockInterruptibly() | void lockInterruptibly() |
newCondition | newCondition() | Condition newCondition() |
tryLock | tryLock() | boolean tryLock() |
unlock | unlock() | void unlock() |
LockSupport#
class final · extends Object · java.util.concurrent.locks.LockSupport
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@park | @park(blocker) | static void park(Object blocker) |
getBlocker | getBlocker(t) | static Object getBlocker(Thread t) |
park | park() | static void park() |
parkNanos | parkNanos(nanos)parkNanos([blocker,nanos])parkNanos([ :blocker = v, :nanos = v ]) | static void parkNanos(long nanos)static void parkNanos(Object blocker, long nanos) |
parkUntil | parkUntil(deadline)parkUntil([blocker,deadline])parkUntil([ :blocker = v, :deadline = v ]) | static void parkUntil(long deadline)static void parkUntil(Object blocker, long deadline) |
setCurrentBlocker | setCurrentBlocker(blocker) | static void setCurrentBlocker(Object blocker) |
unpark | unpark(thread) | static void unpark(Thread thread) |
The methods and fields of Object are inherited.
ReadWriteLock#
interface · java.util.concurrent.locks.ReadWriteLock
Methods
| Method | Ring call | Java overloads |
|---|---|---|
readLock | readLock() | Lock readLock() |
writeLock | writeLock() | Lock writeLock() |
ReentrantLock#
class · extends Object · java.util.concurrent.locks.ReentrantLock
Implements: Lock, Serializable
Constructors
new ReentrantLock() |
new ReentrantLock(boolean fair) |
Ring: new ReentrantLock(args) uses the constructor with the fewest parameters (at least one); new ReentrantLock makes the object with the constructor without parameters; the others: (new ReentrantLock).@New([ :param = value ]) or .@New([v1,v2]).
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@tryLock | @tryLock([timeout,unit])@tryLock([ :timeout = v, :unit = v ]) | boolean tryLock(long timeout, TimeUnit unit) |
getHoldCount | getHoldCount() | int getHoldCount() |
getQueueLength | getQueueLength() | int getQueueLength() |
getWaitQueueLength | getWaitQueueLength(condition) | int getWaitQueueLength(Condition condition) |
hasQueuedThread | hasQueuedThread(thread) | boolean hasQueuedThread(Thread thread) |
hasQueuedThreads | hasQueuedThreads() | boolean hasQueuedThreads() |
hasWaiters | hasWaiters(condition) | boolean hasWaiters(Condition condition) |
isFair | isFair() | boolean isFair() |
isHeldByCurrentThread | isHeldByCurrentThread() | boolean isHeldByCurrentThread() |
isLocked | isLocked() | boolean isLocked() |
lock | lock() | void lock() |
lockInterruptibly | lockInterruptibly() | void lockInterruptibly() |
newCondition | newCondition() | Condition newCondition() |
tryLock | tryLock() | boolean tryLock() |
unlock | unlock() | void unlock() |
The methods and fields of Object are inherited.
ReentrantReadWriteLock#
class · extends Object · java.util.concurrent.locks.ReentrantReadWriteLock
Implements: ReadWriteLock, Serializable
Constructors
new ReentrantReadWriteLock() |
new ReentrantReadWriteLock(boolean fair) |
Ring: new ReentrantReadWriteLock(args) uses the constructor with the fewest parameters (at least one); new ReentrantReadWriteLock makes the object with the constructor without parameters; the others: (new ReentrantReadWriteLock).@New([ :param = value ]) or .@New([v1,v2]).
Methods
| Method | Ring call | Java overloads |
|---|---|---|
getQueueLength | getQueueLength() | int getQueueLength() |
getReadHoldCount | getReadHoldCount() | int getReadHoldCount() |
getReadLockCount | getReadLockCount() | int getReadLockCount() |
getWaitQueueLength | getWaitQueueLength(condition) | int getWaitQueueLength(Condition condition) |
getWriteHoldCount | getWriteHoldCount() | int getWriteHoldCount() |
hasQueuedThread | hasQueuedThread(thread) | boolean hasQueuedThread(Thread thread) |
hasQueuedThreads | hasQueuedThreads() | boolean hasQueuedThreads() |
hasWaiters | hasWaiters(condition) | boolean hasWaiters(Condition condition) |
isFair | isFair() | boolean isFair() |
isWriteLocked | isWriteLocked() | boolean isWriteLocked() |
isWriteLockedByCurrentThread | isWriteLockedByCurrentThread() | boolean isWriteLockedByCurrentThread() |
readLock | readLock() | ReadLock readLock() |
writeLock | writeLock() | WriteLock writeLock() |
The methods and fields of Object are inherited.
ReentrantReadWriteLockReadLock#
class · extends Object · java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock
Implements: Lock, Serializable
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@tryLock | @tryLock([timeout,unit])@tryLock([ :timeout = v, :unit = v ]) | boolean tryLock(long timeout, TimeUnit unit) |
lock | lock() | void lock() |
lockInterruptibly | lockInterruptibly() | void lockInterruptibly() |
newCondition | newCondition() | Condition newCondition() |
tryLock | tryLock() | boolean tryLock() |
unlock | unlock() | void unlock() |
The methods and fields of Object are inherited.
ReentrantReadWriteLockWriteLock#
class · extends Object · java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock
Implements: Lock, Serializable
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@tryLock | @tryLock([timeout,unit])@tryLock([ :timeout = v, :unit = v ]) | boolean tryLock(long timeout, TimeUnit unit) |
getHoldCount | getHoldCount() | int getHoldCount() |
isHeldByCurrentThread | isHeldByCurrentThread() | boolean isHeldByCurrentThread() |
lock | lock() | void lock() |
lockInterruptibly | lockInterruptibly() | void lockInterruptibly() |
newCondition | newCondition() | Condition newCondition() |
tryLock | tryLock() | boolean tryLock() |
unlock | unlock() | void unlock() |
The methods and fields of Object are inherited.
StampedLock#
class · extends Object · java.util.concurrent.locks.StampedLock
Implements: Serializable
Constructors
new StampedLock() |
Ring: new StampedLock(args) uses the constructor with the fewest parameters (at least one); new StampedLock makes the object with the constructor without parameters; the others: (new StampedLock).@New([ :param = value ]) or .@New([v1,v2]).
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@tryReadLock | @tryReadLock([time,unit])@tryReadLock([ :time = v, :unit = v ]) | long tryReadLock(long time, TimeUnit unit) |
@tryWriteLock | @tryWriteLock([time,unit])@tryWriteLock([ :time = v, :unit = v ]) | long tryWriteLock(long time, TimeUnit unit) |
asReadLock | asReadLock() | Lock asReadLock() |
asReadWriteLock | asReadWriteLock() | ReadWriteLock asReadWriteLock() |
asWriteLock | asWriteLock() | Lock asWriteLock() |
getReadLockCount | getReadLockCount() | int getReadLockCount() |
isLockStamp | isLockStamp(stamp) | static boolean isLockStamp(long stamp) |
isOptimisticReadStamp | isOptimisticReadStamp(stamp) | static boolean isOptimisticReadStamp(long stamp) |
isReadLocked | isReadLocked() | boolean isReadLocked() |
isReadLockStamp | isReadLockStamp(stamp) | static boolean isReadLockStamp(long stamp) |
isWriteLocked | isWriteLocked() | boolean isWriteLocked() |
isWriteLockStamp | isWriteLockStamp(stamp) | static boolean isWriteLockStamp(long stamp) |
readLock | readLock() | long readLock() |
readLockInterruptibly | readLockInterruptibly() | long readLockInterruptibly() |
tryConvertToOptimisticRead | tryConvertToOptimisticRead(stamp) | long tryConvertToOptimisticRead(long stamp) |
tryConvertToReadLock | tryConvertToReadLock(stamp) | long tryConvertToReadLock(long stamp) |
tryConvertToWriteLock | tryConvertToWriteLock(stamp) | long tryConvertToWriteLock(long stamp) |
tryOptimisticRead | tryOptimisticRead() | long tryOptimisticRead() |
tryReadLock | tryReadLock() | long tryReadLock() |
tryUnlockRead | tryUnlockRead() | boolean tryUnlockRead() |
tryUnlockWrite | tryUnlockWrite() | boolean tryUnlockWrite() |
tryWriteLock | tryWriteLock() | long tryWriteLock() |
unlock | unlock(stamp) | void unlock(long stamp) |
unlockRead | unlockRead(stamp) | void unlockRead(long stamp) |
unlockWrite | unlockWrite(stamp) | void unlockWrite(long stamp) |
validate | validate(stamp) | boolean validate(long stamp) |
writeLock | writeLock() | long writeLock() |
writeLockInterruptibly | writeLockInterruptibly() | long writeLockInterruptibly() |
The methods and fields of Object are inherited.