< prev index next >

src/java.rmi/share/classes/sun/rmi/transport/GC.java

Print this page
rev 14891 : 8160513: ClassNotFoundException sun.misc.GC when running Tomcat 9 with JDK 9
Reviewed-by:


 127                     }
 128                 }
 129             }
 130         }
 131 
 132         private Daemon(ThreadGroup tg) {
 133             super(tg, null, "GC Daemon", 0L, false);
 134         }
 135 
 136         /* Create a new daemon thread in the root thread group */
 137         public static void create() {
 138             PrivilegedAction<Void> pa = new PrivilegedAction<Void>() {
 139                 public Void run() {
 140                     ThreadGroup tg = Thread.currentThread().getThreadGroup();
 141                     for (ThreadGroup tgn = tg;
 142                          tgn != null;
 143                          tg = tgn, tgn = tg.getParent());
 144                     Daemon d = new Daemon(tg);
 145                     d.setDaemon(true);
 146                     d.setPriority(Thread.MIN_PRIORITY + 1);





 147                     d.start();
 148                     GC.daemon = d;
 149                     return null;
 150                 }};
 151             AccessController.doPrivileged(pa);
 152         }
 153 
 154     }
 155 
 156 
 157     /* Sets the latency target to the given value.
 158      * Must be invoked while holding the lock.
 159      */
 160     private static void setLatencyTarget(long ms) {
 161         latencyTarget = ms;
 162         if (daemon == null) {
 163             /* Create a new daemon thread */
 164             Daemon.create();
 165         } else {
 166             /* Notify the existing daemon thread




 127                     }
 128                 }
 129             }
 130         }
 131 
 132         private Daemon(ThreadGroup tg) {
 133             super(tg, null, "GC Daemon", 0L, false);
 134         }
 135 
 136         /* Create a new daemon thread in the root thread group */
 137         public static void create() {
 138             PrivilegedAction<Void> pa = new PrivilegedAction<Void>() {
 139                 public Void run() {
 140                     ThreadGroup tg = Thread.currentThread().getThreadGroup();
 141                     for (ThreadGroup tgn = tg;
 142                          tgn != null;
 143                          tg = tgn, tgn = tg.getParent());
 144                     Daemon d = new Daemon(tg);
 145                     d.setDaemon(true);
 146                     d.setPriority(Thread.MIN_PRIORITY + 1);
 147                     /* Set the context class loader to null in order to avoid
 148                      * keeping a strong reference to the TCCL of whatever
 149                      * thread triggered the creation of this Daemon.
 150                      */
 151                     d.setContextClassLoader(null);
 152                     d.start();
 153                     GC.daemon = d;
 154                     return null;
 155                 }};
 156             AccessController.doPrivileged(pa);
 157         }
 158 
 159     }
 160 
 161 
 162     /* Sets the latency target to the given value.
 163      * Must be invoked while holding the lock.
 164      */
 165     private static void setLatencyTarget(long ms) {
 166         latencyTarget = ms;
 167         if (daemon == null) {
 168             /* Create a new daemon thread */
 169             Daemon.create();
 170         } else {
 171             /* Notify the existing daemon thread


< prev index next >