equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2017, 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 |
244 * Shutdown all tasks waiting for I/O events. |
244 * Shutdown all tasks waiting for I/O events. |
245 */ |
245 */ |
246 abstract void shutdownHandlerTasks(); |
246 abstract void shutdownHandlerTasks(); |
247 |
247 |
248 private void shutdownExecutors() { |
248 private void shutdownExecutors() { |
249 AccessController.doPrivileged(new PrivilegedAction<>() { |
249 AccessController.doPrivileged( |
250 public Void run() { |
250 new PrivilegedAction<>() { |
251 pool.executor().shutdown(); |
251 public Void run() { |
252 timeoutExecutor.shutdown(); |
252 pool.executor().shutdown(); |
253 return null; |
253 timeoutExecutor.shutdown(); |
254 } |
254 return null; |
255 }); |
255 } |
|
256 }, |
|
257 null, |
|
258 new RuntimePermission("modifyThread")); |
256 } |
259 } |
257 |
260 |
258 @Override |
261 @Override |
259 public final void shutdown() { |
262 public final void shutdown() { |
260 if (shutdown.getAndSet(true)) { |
263 if (shutdown.getAndSet(true)) { |