private class LockManager.Lock
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) int[] |
counters
Array of lock counters.
|
private java.lang.String |
id
Lock ID
|
private int |
type
Lock type
|
Constructor and Description |
---|
Lock(java.lang.String id,
int type)
Construct new Lock object.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
enter(int lockType)
Increment lock count.
|
(package private) int |
getCount()
Get lock count.
|
java.lang.String |
getId()
Get lock ID.
|
(package private) int |
getType()
Get lock type.
|
(package private) void |
leave(int lockType)
Decrement lock count.
|
java.lang.String |
toString()
Dump current lock state into
String . |
(package private) boolean |
upgrade()
Upgrade lock from RX to WX type.
|
(package private) void |
upgradeInt()
All internals of the lock upgrade are collected here.
|
int[] counters
private java.lang.String id
private int type
Lock(java.lang.String id, int type)
id
- Directory object ID.type
- Lock type.public java.lang.String toString()
String
.toString
in class java.lang.Object
String
with dump of current lock state.Object.toString()
void enter(int lockType)
lockType
- Type of lock to set,int getCount()
int getType()
public java.lang.String getId()
void leave(int lockType)
lockType
- Type of lock to remove,boolean upgrade()
void upgradeInt()