8159590: Remove deprecated methods from jdk.internal.misc.VM
Reviewed-by: chegar, dholmes
This commit is contained in:
parent
2a16316429
commit
6c5912ccaa
jdk/src/java.base/share/classes
@ -60,7 +60,6 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
|
||||
int maxPriority;
|
||||
boolean destroyed;
|
||||
boolean daemon;
|
||||
boolean vmAllowSuspension;
|
||||
|
||||
int nUnstartedThreads = 0;
|
||||
int nthreads;
|
||||
@ -121,7 +120,6 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
|
||||
this.name = name;
|
||||
this.maxPriority = parent.maxPriority;
|
||||
this.daemon = parent.daemon;
|
||||
this.vmAllowSuspension = parent.vmAllowSuspension;
|
||||
this.parent = parent;
|
||||
parent.add(this);
|
||||
}
|
||||
@ -1075,10 +1073,6 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
|
||||
*/
|
||||
@Deprecated(since="1.2")
|
||||
public boolean allowThreadSuspension(boolean b) {
|
||||
this.vmAllowSuspension = b;
|
||||
if (!b) {
|
||||
VM.unsuspendSomeThreads();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -30,120 +30,6 @@ import java.util.Properties;
|
||||
|
||||
public class VM {
|
||||
|
||||
/* The following methods used to be native methods that instruct
|
||||
* the VM to selectively suspend certain threads in low-memory
|
||||
* situations. They are inherently dangerous and not implementable
|
||||
* on native threads. We removed them in JDK 1.2. The skeletons
|
||||
* remain so that existing applications that use these methods
|
||||
* will still work.
|
||||
*/
|
||||
private static boolean suspended = false;
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static boolean threadsSuspended() {
|
||||
return suspended;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static boolean allowThreadSuspension(ThreadGroup g, boolean b) {
|
||||
return g.allowThreadSuspension(b);
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static boolean suspendThreads() {
|
||||
suspended = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Causes any suspended threadgroups to be resumed.
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static void unsuspendThreads() {
|
||||
suspended = false;
|
||||
}
|
||||
|
||||
// Causes threadgroups no longer marked suspendable to be resumed.
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static void unsuspendSomeThreads() {
|
||||
}
|
||||
|
||||
/* Deprecated fields and methods -- Memory advice not supported in 1.2 */
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static final int STATE_GREEN = 1;
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static final int STATE_YELLOW = 2;
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static final int STATE_RED = 3;
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static final int getState() {
|
||||
return STATE_GREEN;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static void registerVMNotification(VMNotification n) { }
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static void asChange(int as_old, int as_new) { }
|
||||
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public static void asChange_otherthread(int as_old, int as_new) { }
|
||||
|
||||
/*
|
||||
* Not supported in 1.2 because these will have to be exported as
|
||||
* JVM functions, and we are not sure we want do that. Leaving
|
||||
* here so it can be easily resurrected -- just remove the //
|
||||
* comments.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resume Java profiling. All profiling data is added to any
|
||||
* earlier profiling, unless <code>resetJavaProfiler</code> is
|
||||
* called in between. If profiling was not started from the
|
||||
* command line, <code>resumeJavaProfiler</code> will start it.
|
||||
* <p>
|
||||
*
|
||||
* NOTE: Profiling must be enabled from the command line for a
|
||||
* java.prof report to be automatically generated on exit; if not,
|
||||
* writeJavaProfilerReport must be invoked to write a report.
|
||||
*
|
||||
* @see resetJavaProfiler
|
||||
* @see writeJavaProfilerReport
|
||||
*/
|
||||
|
||||
// public native static void resumeJavaProfiler();
|
||||
|
||||
/**
|
||||
* Suspend Java profiling.
|
||||
*/
|
||||
// public native static void suspendJavaProfiler();
|
||||
|
||||
/**
|
||||
* Initialize Java profiling. Any accumulated profiling
|
||||
* information is discarded.
|
||||
*/
|
||||
// public native static void resetJavaProfiler();
|
||||
|
||||
/**
|
||||
* Write the current profiling contents to the file "java.prof".
|
||||
* If the file already exists, it will be overwritten.
|
||||
*/
|
||||
// public native static void writeJavaProfilerReport();
|
||||
|
||||
|
||||
// the init level when the VM is fully initialized
|
||||
private static final int JAVA_LANG_SYSTEM_INITED = 1;
|
||||
private static final int MODULE_SYSTEM_INITED = 2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user