Package com.strobel.concurrent
Class StripedLock<T>
- java.lang.Object
-
- com.strobel.concurrent.StripedLock<T>
-
- Direct Known Subclasses:
StripedReentrantLock
public abstract class StripedLock<T> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private int
_lockAllocationCounter
private static int
LOCK_COUNT
protected T[]
locks
-
Constructor Summary
Constructors Modifier Constructor Description protected
StripedLock(java.lang.Class<T> lockType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
allocateLock()
int
allocateLockIndex()
protected abstract T
createLock()
abstract void
lock(int index)
abstract void
unlock(int index)
-
-
-
Field Detail
-
LOCK_COUNT
private static final int LOCK_COUNT
- See Also:
- Constant Field Values
-
locks
protected final T[] locks
-
_lockAllocationCounter
private int _lockAllocationCounter
-
-
Constructor Detail
-
StripedLock
protected StripedLock(java.lang.Class<T> lockType)
-
-