home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / misc / VM.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  1.8 KB  |  56 lines

  1. package sun.misc;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.Vector;
  5.  
  6. // $FF: renamed from: sun.misc.VM
  7. public class class_0 {
  8.    public static final int STATE_GREEN = 1;
  9.    public static final int STATE_YELLOW = 2;
  10.    public static final int STATE_RED = 3;
  11.    static Vector callbacks = new Vector();
  12.    static VMNotifierThread notifier;
  13.    static VMNotifierThread notifier_red = new VMNotifierThread("Red Alloc State Notifier");
  14.  
  15.    public static final native int getState();
  16.  
  17.    static final native boolean threadsSuspended();
  18.  
  19.    public static boolean allowThreadSuspension(ThreadGroup var0, boolean var1) {
  20.       return var0.allowThreadSuspension(var1);
  21.    }
  22.  
  23.    public static native void unsuspendThreads();
  24.  
  25.    public static native void unsuspendSomeThreads();
  26.  
  27.    public static void registerVMNotification(VMNotification var0) {
  28.       callbacks.addElement(var0);
  29.    }
  30.  
  31.    static VMNotifierThread whichNotifier(int var0) {
  32.       return var0 == 3 ? notifier_red : notifier;
  33.    }
  34.  
  35.    public static void asChange(int var0, int var1) {
  36.       whichNotifier(var1).enqueue(var0, var1);
  37.    }
  38.  
  39.    public static void asChange_otherthread(int var0, int var1) {
  40.       Enumeration var2 = callbacks.elements();
  41.  
  42.       while(var2.hasMoreElements()) {
  43.          ((VMNotification)var2.nextElement()).newAllocState(var0, var1, true);
  44.       }
  45.  
  46.    }
  47.  
  48.    static {
  49.       notifier_red.setPriority(10);
  50.       notifier_red.start();
  51.       notifier = new VMNotifierThread("Alloc State Notifier");
  52.       notifier.setPriority(notifier_red.getPriority() - 1);
  53.       notifier.start();
  54.    }
  55. }
  56.