public class SemaphoreReadWriteLock extends java.lang.Object implements java.util.concurrent.locks.ReadWriteLock
ReadWriteLock
implementation that uses a semaphore.
A read lock requires 1 permit, while a write lock requires all the permits.
Lock upgrading and downgrading is not supported; nor are conditions.Constructor and Description |
---|
SemaphoreReadWriteLock(boolean fair) |
SemaphoreReadWriteLock(int permits,
boolean fair) |
public SemaphoreReadWriteLock(boolean fair)
public SemaphoreReadWriteLock(int permits, boolean fair)
public java.util.concurrent.locks.Lock readLock()
readLock
in interface java.util.concurrent.locks.ReadWriteLock
ReadWriteLock.readLock()
public java.util.concurrent.locks.Lock writeLock()
writeLock
in interface java.util.concurrent.locks.ReadWriteLock
ReadWriteLock.writeLock()