public class Collection extends Collection
Modifier and Type | Field and Description |
---|---|
private static RVMThread.SoftHandshakeVisitor |
mutatorFlushVisitor |
EXTERNAL_GC_TRIGGER, INTERNAL_GC_TRIGGER, INTERNAL_PHASE_GC_TRIGGER, RESOURCE_GC_TRIGGER, TRIGGER_REASONS, triggerReasons, UNKNOWN_GC_TRIGGER
Constructor and Description |
---|
Collection() |
Modifier and Type | Method and Description |
---|---|
void |
blockForGC()
Block for the garbage collector.
|
int |
getActiveThreads() |
int |
getDefaultThreads() |
void |
outOfMemory()
Fail with an out of memory error.
|
void |
prepareMutator(MutatorContext m)
Prepare a mutator for collection.
|
void |
requestMutatorFlush()
Request each mutator flush remembered sets.
|
void |
resumeAllMutators()
Resume all mutators blocked for GC.
|
static void |
scheduleFinalizerThread()
Schedule the finalizerThread, if there are objects to be
finalized and the finalizerThread is on its queue (ie. currently
idle).
|
void |
spawnCollectorContext(CollectorContext context)
Spawns a thread to execute the supplied collector context.
|
void |
stopAllMutators()
Stop all mutator threads.
|
private static RVMThread.SoftHandshakeVisitor mutatorFlushVisitor
public Collection()
public void spawnCollectorContext(CollectorContext context)
spawnCollectorContext
in class Collection
context
- the context to executepublic int getDefaultThreads()
getDefaultThreads
in class Collection
public int getActiveThreads()
getActiveThreads
in class Collection
public void blockForGC()
Collection
blockForGC
in class Collection
public void outOfMemory()
outOfMemory
in class Collection
public final void prepareMutator(MutatorContext m)
Collection
prepareMutator
in class Collection
m
- the mutator to preparepublic void stopAllMutators()
Collection
Fixpoint until there are no threads that we haven't blocked. Fixpoint is needed to catch the (unlikely) case that a thread spawns another thread while we are waiting.
stopAllMutators
in class Collection
public void resumeAllMutators()
Collection
resumeAllMutators
in class Collection
public void requestMutatorFlush()
Collection
requestMutatorFlush
in class Collection
public static void scheduleFinalizerThread()