org.jikesrvm.mm.mmtk
Class SynchronizedCounter
java.lang.Object
org.mmtk.vm.SynchronizedCounter
org.jikesrvm.mm.mmtk.SynchronizedCounter
public final class SynchronizedCounter
- extends SynchronizedCounter
A counter that supports atomic increment and reset.
Method Summary |
static void |
boot()
|
int |
increment()
Adds 1 to the counter. |
int |
peek()
Peek at the counter |
int |
reset()
Reset the counter to 0, returning its previous value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
offset
private static Offset offset
count
private int count
SynchronizedCounter
public SynchronizedCounter()
boot
public static void boot()
reset
public int reset()
- Description copied from class:
SynchronizedCounter
- Reset the counter to 0, returning its previous value.
- Specified by:
reset
in class SynchronizedCounter
- Returns:
- The value of the counter, prior to reset.
increment
public int increment()
- Description copied from class:
SynchronizedCounter
- Adds 1 to the counter.
- Specified by:
increment
in class SynchronizedCounter
- Returns:
- the value before the add
peek
public int peek()
- Description copied from class:
SynchronizedCounter
- Peek at the counter
- Specified by:
peek
in class SynchronizedCounter
- Returns:
- The current value of the counter.