equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 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 |
53 import sun.awt.FontConfiguration; |
53 import sun.awt.FontConfiguration; |
54 import sun.awt.SunToolkit; |
54 import sun.awt.SunToolkit; |
55 import sun.awt.util.ThreadGroupUtils; |
55 import sun.awt.util.ThreadGroupUtils; |
56 import sun.java2d.FontSupport; |
56 import sun.java2d.FontSupport; |
57 import sun.misc.InnocuousThread; |
57 import sun.misc.InnocuousThread; |
|
58 import sun.misc.ManagedLocalsThread; |
58 import sun.util.logging.PlatformLogger; |
59 import sun.util.logging.PlatformLogger; |
59 |
60 |
60 /** |
61 /** |
61 * The base implementation of the {@link FontManager} interface. It implements |
62 * The base implementation of the {@link FontManager} interface. It implements |
62 * the platform independent, shared parts of OpenJDK's FontManager |
63 * the platform independent, shared parts of OpenJDK's FontManager |
2499 |
2500 |
2500 }); |
2501 }); |
2501 } |
2502 } |
2502 }; |
2503 }; |
2503 AccessController.doPrivileged((PrivilegedAction<Void>) () -> { |
2504 AccessController.doPrivileged((PrivilegedAction<Void>) () -> { |
2504 if (System.getSecurityManager() == null) { |
2505 ThreadGroup rootTG = ThreadGroupUtils.getRootThreadGroup(); |
2505 ThreadGroup rootTG = ThreadGroupUtils.getRootThreadGroup(); |
2506 fileCloser = new ManagedLocalsThread(rootTG, |
2506 fileCloser = new Thread(rootTG, fileCloserRunnable); |
2507 fileCloserRunnable); |
2507 } else { |
|
2508 fileCloser = new InnocuousThread(fileCloserRunnable); |
|
2509 } |
|
2510 fileCloser.setContextClassLoader(null); |
2508 fileCloser.setContextClassLoader(null); |
2511 Runtime.getRuntime().addShutdownHook(fileCloser); |
2509 Runtime.getRuntime().addShutdownHook(fileCloser); |
2512 return null; |
2510 return null; |
2513 }); |
2511 }); |
2514 } |
2512 } |