View | Details | Raw Unified | Return to bug 50175
Collapse All | Expand All

(-)java/org/apache/catalina/loader/WebappClassLoader.java (+8 lines)
Lines 2179-2184 Link Here
2179
    @SuppressWarnings("deprecation") // thread.stop()
2179
    @SuppressWarnings("deprecation") // thread.stop()
2180
    private void clearReferencesThreads() {
2180
    private void clearReferencesThreads() {
2181
        Thread[] threads = getThreads();
2181
        Thread[] threads = getThreads();
2182
2183
        // Is checking for a null value better than using the synchronized method?
2184
        boolean shuttingDown = System.getProperties().containsKey("org.apache.catalina.shuttingDown");
2182
        
2185
        
2183
        // Iterate over the set of threads
2186
        // Iterate over the set of threads
2184
        for (Thread thread : threads) {
2187
        for (Thread thread : threads) {
Lines 2194-2199 Link Here
2194
                    if (!thread.isAlive()) {
2197
                    if (!thread.isAlive()) {
2195
                        continue;
2198
                        continue;
2196
                    }
2199
                    }
2200
                    
2201
                    // Skip daemon threads if Tomcat is shutting down
2202
                    if (shuttingDown && thread.isDaemon()) {
2203
                        continue;
2204
                    }
2197
2205
2198
                    // Don't warn about JVM controlled threads
2206
                    // Don't warn about JVM controlled threads
2199
                    ThreadGroup tg = thread.getThreadGroup();
2207
                    ThreadGroup tg = thread.getThreadGroup();
(-)java/org/apache/catalina/startup/Catalina.java (+2 lines)
Lines 633-638 Link Here
633
     * Stop an existing server instance.
633
     * Stop an existing server instance.
634
     */
634
     */
635
    public void stop() {
635
    public void stop() {
636
        
637
        System.setProperty("org.apache.catalina.shuttingDown", String.valueOf(System.currentTimeMillis()));
636
638
637
        try {
639
        try {
638
            // Remove the ShutdownHook first so that server.stop() 
640
            // Remove the ShutdownHook first so that server.stop() 

Return to bug 50175