public class Lock extends Lock
SPIN_LIMIT
).Modifier and Type | Field and Description |
---|---|
private static int |
CLEAR
Lock is not held and the queue is empty.
|
private static int |
CLEAR_QUEUED
Lock is not held but the queue is non-empty.
|
private int |
id |
private static int |
lockCount |
private static int |
LOCKED
Lock is held and the queue is empty.
|
private static int |
LOCKED_QUEUED
Lock is held and the queue is non-empty.
|
private String |
name |
private ThreadQueue |
queue |
private static int |
QUEUEING
Some thread is currently engaged in an enqueue or dequeue operation,
and will return the lock to whatever it was in previously once that
operation is done.
|
private static int |
SPIN_LIMIT |
private int |
state |
private RVMThread |
thread |
private int |
where |
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Try to acquire a lock and spin-wait until acquired.
|
void |
check(int w)
Perform sanity checks on the lock.
|
void |
release()
Release the lock by incrementing serving counter.
|
void |
setName(String str)
Set the name of this lock instance
|
private final int id
private static int lockCount
private static final int SPIN_LIMIT
private static final int CLEAR
private static final int LOCKED
private static final int CLEAR_QUEUED
private static final int LOCKED_QUEUED
private static final int QUEUEING
private final ThreadQueue queue
private int state
private int where
public void setName(String str)
Lock
public void acquire()
Lock
public void check(int w)
Lock