public class ReadWriteUpdateLock
extends java.lang.Object
A read or update lock allows shared access while a write lock enforces exclusive access. Multiple threads can hold the read lock but only one thread can hold the update or write lock. If a thread obtains a lock that it already holds, it must release the lock the same number of times that it obtained the lock.
Modifier and Type | Class and Description |
---|---|
static interface |
ReadWriteUpdateLock.Lock
Lock interface
|
Constructor and Description |
---|
ReadWriteUpdateLock() |
Modifier and Type | Method and Description |
---|---|
ReadWriteUpdateLock.Lock |
readLock()
Return the read lock
|
ReadWriteUpdateLock.Lock |
updateLock()
Return the update lock
|
ReadWriteUpdateLock.Lock |
writeLock()
Return the write lock
|
public ReadWriteUpdateLock.Lock readLock()
public ReadWriteUpdateLock.Lock updateLock()
public ReadWriteUpdateLock.Lock writeLock()