org.mmtk.vm
Class Lock

java.lang.Object
  extended by org.mmtk.vm.Lock
Direct Known Subclasses:
Lock

public abstract class Lock
extends Object

Simple, fair locks with deadlock detection.


Constructor Summary
Lock()
           
 
Method Summary
abstract  void acquire()
          Try to acquire a lock and spin-wait until acquired.
abstract  void check(int w)
          Perform sanity checks on the lock.
abstract  void release()
          Release the lock by incrementing serving counter.
abstract  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
 

Constructor Detail

Lock

public Lock()
Method Detail

setName

public abstract void setName(String str)
Set the name of this lock instance

Parameters:
str - The name of the lock (for error output).

acquire

public abstract void acquire()
Try to acquire a lock and spin-wait until acquired.


check

public abstract void check(int w)
Perform sanity checks on the lock. For debugging.

Parameters:
w - Identifies the code location in the debugging output.

release

public abstract void release()
Release the lock by incrementing serving counter.