31 import java.util.Map;
32 import java.util.Set;
33
34 public class VM {
35
36 /* The following methods used to be native methods that instruct
37 * the VM to selectively suspend certain threads in low-memory
38 * situations. They are inherently dangerous and not implementable
39 * on native threads. We removed them in JDK 1.2. The skeletons
40 * remain so that existing applications that use these methods
41 * will still work.
42 */
43 private static boolean suspended = false;
44
45 /** @deprecated */
46 @Deprecated
47 public static boolean threadsSuspended() {
48 return suspended;
49 }
50
51 public static boolean allowThreadSuspension(ThreadGroup g, boolean b) {
52 return g.allowThreadSuspension(b);
53 }
54
55 /** @deprecated */
56 @Deprecated
57 public static boolean suspendThreads() {
58 suspended = true;
59 return true;
60 }
61
62 // Causes any suspended threadgroups to be resumed.
63 /** @deprecated */
64 @Deprecated
65 public static void unsuspendThreads() {
66 suspended = false;
67 }
68
69 // Causes threadgroups no longer marked suspendable to be resumed.
70 /** @deprecated */
|
31 import java.util.Map;
32 import java.util.Set;
33
34 public class VM {
35
36 /* The following methods used to be native methods that instruct
37 * the VM to selectively suspend certain threads in low-memory
38 * situations. They are inherently dangerous and not implementable
39 * on native threads. We removed them in JDK 1.2. The skeletons
40 * remain so that existing applications that use these methods
41 * will still work.
42 */
43 private static boolean suspended = false;
44
45 /** @deprecated */
46 @Deprecated
47 public static boolean threadsSuspended() {
48 return suspended;
49 }
50
51 @SuppressWarnings("deprecation")
52 public static boolean allowThreadSuspension(ThreadGroup g, boolean b) {
53 return g.allowThreadSuspension(b);
54 }
55
56 /** @deprecated */
57 @Deprecated
58 public static boolean suspendThreads() {
59 suspended = true;
60 return true;
61 }
62
63 // Causes any suspended threadgroups to be resumed.
64 /** @deprecated */
65 @Deprecated
66 public static void unsuspendThreads() {
67 suspended = false;
68 }
69
70 // Causes threadgroups no longer marked suspendable to be resumed.
71 /** @deprecated */
|