public class StripedCompositeReadWriteLock extends Object implements ReadWriteLock
ReentrantReadWriteLock it has slightly improved performance of ReadWriteLock.readLock()
operations at the cost of ReadWriteLock.writeLock() operations and memory consumption.
It also supports reentrancy semantics like ReentrantReadWriteLock.| Constructor and Description |
|---|
StripedCompositeReadWriteLock(int concurrencyLvl)
Creates a new instance with given concurrency level.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getReadHoldCount()
Queries the number of reentrant read holds on this lock by the
current thread.
|
boolean |
isWriteLockedByCurrentThread()
Queries if the write lock is held by the current thread.
|
@NotNull Lock |
readLock() |
@NotNull Lock |
writeLock() |
public StripedCompositeReadWriteLock(int concurrencyLvl)
concurrencyLvl - Number of internal read locks.@NotNull public @NotNull Lock readLock()
readLock in interface ReadWriteLock@NotNull public @NotNull Lock writeLock()
writeLock in interface ReadWriteLockpublic boolean isWriteLockedByCurrentThread()
true if the current thread holds the write lock and
false otherwisepublic int getReadHoldCount()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023