class ForkedMain
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ForkedMain.HangupThread
Hangup thread will detach us from the host VM properly, in three cases:
- normal shutdown
- shutdown with benchmark exception
- any System.exit call
The need to intercept System.exit calls is the reason to register ourselves
as the shutdown hook.
|
private static class |
ForkedMain.ShutdownTimeoutThread
Shutdown timeout thread will forcefully exit the VM in two cases:
- stray non-daemon thread prevents the VM from exiting
- all user threads have finished, but we are stuck in some shutdown hook or finalizer
In all other "normal" cases, VM will exit before the timeout expires.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.Throwable |
exception |
private static boolean |
gracefullyFinished |
private static java.util.concurrent.atomic.AtomicBoolean |
hangupFuse |
private static java.util.concurrent.atomic.AtomicReference<BinaryLinkClient> |
linkRef |
private static java.io.PrintStream |
nakedErr |
Constructor and Description |
---|
ForkedMain() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
hangup()
Report our latest status to the host VM, and say goodbye.
|
static void |
main(java.lang.String[] argv)
Application main entry point
|
private static final java.util.concurrent.atomic.AtomicBoolean hangupFuse
private static final java.util.concurrent.atomic.AtomicReference<BinaryLinkClient> linkRef
private static volatile boolean gracefullyFinished
private static volatile java.lang.Throwable exception
private static volatile java.io.PrintStream nakedErr