Class StripedLockContainer
java.lang.Object
org.infinispan.util.concurrent.locks.impl.StripedLockContainer
- All Implemented Interfaces:
LockContainer
A lock container used with lock stripping.
- Since:
- 8.0
- Author:
- Pedro Ruivo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeadlockCheck(DeadlockChecker deadlockChecker) It forces a deadlock checks in all existing locks.intbooleanvoidintsize()toString()
-
Constructor Details
-
StripedLockContainer
public StripedLockContainer(int concurrencyLevel)
-
-
Method Details
-
acquire
- Specified by:
acquirein interfaceLockContainer- Parameters:
key- the key to lock.- Returns:
- the lock for a specific object to be acquired. If the lock does not exists, it is created.
-
release
- Specified by:
releasein interfaceLockContainer
-
getLock
- Specified by:
getLockin interfaceLockContainer- Parameters:
key- the key to lock.- Returns:
- the lock for a specific object. If the lock does not exists, it return
null.
-
getNumLocksHeld
public int getNumLocksHeld()- Specified by:
getNumLocksHeldin interfaceLockContainer- Returns:
- number of locks held
-
isLocked
- Specified by:
isLockedin interfaceLockContainer- Parameters:
key- the key to test.- Returns:
trueif the key is locked,falseotherwise.
-
size
public int size()- Specified by:
sizein interfaceLockContainer- Returns:
- the size of the shared lock pool
-
deadlockCheck
Description copied from interface:LockContainerIt forces a deadlock checks in all existing locks.- Specified by:
deadlockCheckin interfaceLockContainer
-
toString
-