|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.vm.Lock org.jikesrvm.mm.mmtk.Lock
public class Lock
Adaptive mutex with a spinlock fast path. Designed for good performance on native threaded systems. This implementation has the following specific properties:
SPIN_LIMIT
).
Field Summary | |
---|---|
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
|
Constructor Summary | |
---|---|
Lock()
|
|
Lock(String name)
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String name
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 ThreadQueue queue
private int state
private RVMThread thread
private int where
Constructor Detail |
---|
public Lock(String name)
public Lock()
Method Detail |
---|
public void setName(String str)
Lock
setName
in class Lock
str
- The name of the lock (for error output).public void acquire()
Lock
acquire
in class Lock
public void check(int w)
Lock
check
in class Lock
w
- Identifies the code location in the debugging output.public void release()
Lock
release
in class Lock
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |