public final class VMOperationControl extends Object
At the moment, we support three different processing modes:
VMOperationControl.immediateQueues
).
If a VM operation was queued successfully, it is guaranteed that the VM operation will get executed at some point in time. This is crucial for NativeVMOperations as their mutable state (see NativeVMOperationData) could be allocated on the stack.
To avoid unexpected exceptions, we do the following before queuing and executing a VM operation:
Modifier and Type | Class and Description |
---|---|
protected static class |
VMOperationControl.AllocationFreeQueue<T> |
protected static class |
VMOperationControl.JavaAllocationFreeQueue<T extends VMOperationControl.JavaAllocationFreeQueue.Element<T>>
A queue that does not allocate because each element has a next pointer.
|
protected static class |
VMOperationControl.JavaVMOperationQueue |
protected static class |
VMOperationControl.NativeVMOperationQueue
Same implementation as
VMOperationControl.JavaAllocationFreeQueue but for elements of type
NativeVMOperationData . |
protected static class |
VMOperationControl.OpInProgress
This class holds the information about the
VMOperation that is currently in progress. |
static class |
VMOperationControl.VMOperationThread
A dedicated thread that executes
VMOperation s. |
Modifier and Type | Method and Description |
---|---|
void |
enqueueFromNonJavaThread(NativeVMOperation operation,
NativeVMOperationData data) |
static VMOperationControl.VMOperationThread |
getDedicatedVMOperationThread() |
static void |
guaranteeOkayToBlock(String message)
Check if it is okay for this thread to block.
|
static boolean |
isDedicatedVMOperationThread() |
static boolean |
isDedicatedVMOperationThread(org.graalvm.nativeimage.IsolateThread thread) |
static boolean |
isFrozen()
This method returns true if the application is currently stopped at a safepoint.
|
static void |
logRecentEvents(Log log) |
protected static void |
markAsQueued(VMOperation operation,
NativeVMOperationData data) |
static boolean |
mayExecuteVmOperations() |
static void |
shutdownAndDetachVMOperationThread() |
static void |
startVMOperationThread() |
public static VMOperationControl.VMOperationThread getDedicatedVMOperationThread()
public static void startVMOperationThread()
public static void shutdownAndDetachVMOperationThread()
public static boolean isDedicatedVMOperationThread()
public static boolean isDedicatedVMOperationThread(org.graalvm.nativeimage.IsolateThread thread)
public static boolean mayExecuteVmOperations()
public static void logRecentEvents(Log log)
public void enqueueFromNonJavaThread(NativeVMOperation operation, NativeVMOperationData data)
protected static void markAsQueued(VMOperation operation, NativeVMOperationData data)
public static void guaranteeOkayToBlock(String message)
public static boolean isFrozen()