jdk/src/java.desktop/share/classes/sun/awt/AppContext.java
changeset 31653 d88ff422c7fb
parent 30948 0a0972d3b58d
child 32834 e1dca5fe4de3
child 32865 f9cb6e427f9e
equal deleted inserted replaced
31652:4f5a98844329 31653:d88ff422c7fb
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    42 import java.util.HashSet;
    42 import java.util.HashSet;
    43 import java.beans.PropertyChangeSupport;
    43 import java.beans.PropertyChangeSupport;
    44 import java.beans.PropertyChangeListener;
    44 import java.beans.PropertyChangeListener;
    45 import java.lang.ref.SoftReference;
    45 import java.lang.ref.SoftReference;
    46 
    46 
    47 import sun.misc.InnocuousThread;
    47 import sun.misc.ManagedLocalsThread;
    48 import sun.util.logging.PlatformLogger;
    48 import sun.util.logging.PlatformLogger;
    49 import java.util.concurrent.locks.Condition;
    49 import java.util.concurrent.locks.Condition;
    50 import java.util.concurrent.locks.Lock;
    50 import java.util.concurrent.locks.Lock;
    51 import java.util.concurrent.locks.ReentrantLock;
    51 import java.util.concurrent.locks.ReentrantLock;
    52 import java.util.concurrent.atomic.AtomicInteger;
    52 import java.util.concurrent.atomic.AtomicInteger;
   589             appContext = ac;
   589             appContext = ac;
   590             runnable = r;
   590             runnable = r;
   591         }
   591         }
   592 
   592 
   593         public Thread run() {
   593         public Thread run() {
   594             Thread t;
   594             Thread t = new ManagedLocalsThread(appContext.getThreadGroup(),
   595             if (System.getSecurityManager() == null) {
   595                                                runnable, "AppContext Disposer");
   596                 t = new Thread(appContext.getThreadGroup(), runnable);
   596             t.setContextClassLoader(appContext.getContextClassLoader());
   597             } else {
       
   598                 t = new InnocuousThread(appContext.getThreadGroup(), runnable, "AppContext Disposer");
       
   599             }
       
   600             t.setContextClassLoader(null);
       
   601             t.setPriority(Thread.NORM_PRIORITY + 1);
   597             t.setPriority(Thread.NORM_PRIORITY + 1);
   602             t.setDaemon(true);
   598             t.setDaemon(true);
   603             return t;
   599             return t;
   604         }
   600         }
   605     }
   601     }