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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deadlockCheck
(DeadlockChecker deadlockChecker) It forces a deadlock checks in all existing locks.int
boolean
void
int
size()
toString()
-
Constructor Details
-
StripedLockContainer
public StripedLockContainer(int concurrencyLevel)
-
-
Method Details
-
acquire
- Specified by:
acquire
in 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:
release
in interfaceLockContainer
-
getLock
- Specified by:
getLock
in 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:
getNumLocksHeld
in interfaceLockContainer
- Returns:
- number of locks held
-
isLocked
- Specified by:
isLocked
in interfaceLockContainer
- Parameters:
key
- the key to test.- Returns:
true
if the key is locked,false
otherwise.
-
size
public int size()- Specified by:
size
in interfaceLockContainer
- Returns:
- the size of the shared lock pool
-
deadlockCheck
Description copied from interface:LockContainer
It forces a deadlock checks in all existing locks.- Specified by:
deadlockCheck
in interfaceLockContainer
-
toString
-