Additional top-level class in compilation unit: LockList.
A LockSpace can have an owner (for instance a
transaction). Currently, the owner is used by the virtual lock table to
find out which transaction a lock belongs to. Some parts of the code also
use the owner as a group object which guarantees that the lock is released
on a commit or an abort. The owner has no special meaning to the lock
manager and can be any object, including null.
| Modifier and Type | Field and Description |
|---|---|
| private Limit | |
| private Object | |
| private final HashMap | groups
Map from group references to groups of locks. |
| private boolean | |
| private int | |
| private static final int | MAX_CACHED_GROUPS
The maximum number of elements to cache in |
| private int | |
| private final LockOwner | owner
Reference to the owner of this compatibility space. |
| private final ArrayDeque | spareGroups
Cached HashMaps for storing lock groups. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected synchronized void | |
| pack-priv synchronized boolean | |
| pack-priv synchronized boolean | Returns: true if locks are held, false otherwiseReturn true if locks are held in this compatibility space. |
| pack-priv synchronized void | |
| pack-priv synchronized int | |
| private HashMap | |
| public LockOwner | Returns: the owner of the compatibility spaceImplements org. Get the object representing the owner of the compatibility space. |
| pack-priv synchronized boolean | |
| private void | |
| private void | |
| pack-priv synchronized void | |
| pack-priv synchronized void | |
| pack-priv synchronized void | |
| pack-priv synchronized void | unlockGroup(LockTable lset, Object group, Matchable key)
Unlock all locks in the group that match the key |
| pack-priv synchronized int |
| callback | back to summary |
|---|---|
| private Limit callback | |
| callbackGroup | back to summary |
|---|---|
| private Object callbackGroup | |
| groups | back to summary |
|---|---|
| private final HashMap<Object, HashMap<Lock, Lock>> groups Map from group references to groups of locks. | |
| inLimit | back to summary |
|---|---|
| private boolean inLimit | |
| limit | back to summary |
|---|---|
| private int limit | |
| MAX_CACHED_GROUPS | back to summary |
|---|---|
| private static final int MAX_CACHED_GROUPS The maximum number of elements to cache in | |
| nextLimitCall | back to summary |
|---|---|
| private int nextLimitCall | |
| owner | back to summary |
|---|---|
| private final LockOwner owner Reference to the owner of this compatibility space. | |
| spareGroups | back to summary |
|---|---|
| private final ArrayDeque<HashMap<Lock, Lock>> spareGroups Cached HashMaps for storing lock groups. | |
| LockSpace | back to summary |
|---|---|
| pack-priv LockSpace(LockOwner owner) Creates a new
| |
| addLock | back to summary |
|---|---|
| protected synchronized void addLock(Object group, Lock lock) throws StandardException Add a lock to a group. | |
| areLocksHeld | back to summary |
|---|---|
| pack-priv synchronized boolean areLocksHeld(Object group) Return true if locks are held in a group | |
| areLocksHeld | back to summary |
|---|---|
| pack-priv synchronized boolean areLocksHeld() Return true if locks are held in this compatibility space.
| |
| clearLimit | back to summary |
|---|---|
| pack-priv synchronized void clearLimit(Object group) Clear a limit set by setLimit. | |
| deadlockCount | back to summary |
|---|---|
| pack-priv synchronized int deadlockCount(int bail) Return a count of the number of locks held by this space. The argument bail indicates at which point the counting should bail out and return the current count. This routine will bail if the count is greater than bail. Thus this routine is intended to for deadlock code to find the space with the fewest number of locks. | |
| getGroupMap | back to summary |
|---|---|
| private HashMap | |
| getOwner | back to summary |
|---|---|
| public LockOwner getOwner() Implements org. Get the object representing the owner of the compatibility space.
| |
| isLockHeld | back to summary |
|---|---|
| pack-priv synchronized boolean isLockHeld(Object group, Lockable ref, Object qualifier) | |
| mergeGroups | back to summary |
|---|---|
| private void mergeGroups(HashMap<Lock, Lock> from, HashMap<Lock, Lock> into) | |
| saveGroup | back to summary |
|---|---|
| private void saveGroup(HashMap<Lock, Lock> dl) | |
| setLimit | back to summary |
|---|---|
| pack-priv synchronized void setLimit(Object group, int limit, Limit callback) | |
| transfer | back to summary |
|---|---|
| pack-priv synchronized void transfer(Object oldGroup, Object newGroup) | |
| unlockGroup | back to summary |
|---|---|
| pack-priv synchronized void unlockGroup(LockTable lset, Object group) Unlock all the locks in a group and then remove the group. | |
| unlockGroup | back to summary |
|---|---|
| pack-priv synchronized void unlockGroup(LockTable lset, Object group, Matchable key) Unlock all locks in the group that match the key | |
| unlockReference | back to summary |
|---|---|
| pack-priv synchronized int unlockReference(LockTable lset, Lockable ref, Object qualifier, Object group) | |