equal
deleted
inserted
replaced
33 * http://creativecommons.org/publicdomain/zero/1.0/ |
33 * http://creativecommons.org/publicdomain/zero/1.0/ |
34 */ |
34 */ |
35 |
35 |
36 package java.util.concurrent; |
36 package java.util.concurrent; |
37 |
37 |
38 import java.security.AccessControlContext; |
|
39 import java.security.AccessController; |
|
40 import java.security.PrivilegedAction; |
|
41 import java.util.ArrayList; |
38 import java.util.ArrayList; |
42 import java.util.ConcurrentModificationException; |
39 import java.util.ConcurrentModificationException; |
43 import java.util.HashSet; |
40 import java.util.HashSet; |
44 import java.util.Iterator; |
41 import java.util.Iterator; |
45 import java.util.List; |
42 import java.util.List; |
266 * |
263 * |
267 * <dt>Reclamation</dt> |
264 * <dt>Reclamation</dt> |
268 * |
265 * |
269 * <dd>A pool that is no longer referenced in a program <em>AND</em> |
266 * <dd>A pool that is no longer referenced in a program <em>AND</em> |
270 * has no remaining threads may be reclaimed (garbage collected) |
267 * has no remaining threads may be reclaimed (garbage collected) |
271 * without being explicity shutdown. You can configure a pool to allow |
268 * without being explicitly shutdown. You can configure a pool to |
272 * all unused threads to eventually die by setting appropriate |
269 * allow all unused threads to eventually die by setting appropriate |
273 * keep-alive times, using a lower bound of zero core threads and/or |
270 * keep-alive times, using a lower bound of zero core threads and/or |
274 * setting {@link #allowCoreThreadTimeOut(boolean)}. </dd> |
271 * setting {@link #allowCoreThreadTimeOut(boolean)}. </dd> |
275 * |
272 * |
276 * </dl> |
273 * </dl> |
277 * |
274 * |
1460 } finally { |
1457 } finally { |
1461 mainLock.unlock(); |
1458 mainLock.unlock(); |
1462 } |
1459 } |
1463 } |
1460 } |
1464 |
1461 |
|
1462 // Override without "throws Throwable" for compatibility with subclasses |
|
1463 // whose finalize method invokes super.finalize() (as is recommended). |
|
1464 // Before JDK 11, finalize() had a non-empty method body. |
|
1465 |
|
1466 /** |
|
1467 * @implNote Previous versions of this class had a finalize method |
|
1468 * that shut down this executor, but in this version, finalize |
|
1469 * does nothing. |
|
1470 */ |
|
1471 @Deprecated(since="9") |
|
1472 protected void finalize() {} |
|
1473 |
1465 /** |
1474 /** |
1466 * Sets the thread factory used to create new threads. |
1475 * Sets the thread factory used to create new threads. |
1467 * |
1476 * |
1468 * @param threadFactory the new thread factory |
1477 * @param threadFactory the new thread factory |
1469 * @throws NullPointerException if threadFactory is null |
1478 * @throws NullPointerException if threadFactory is null |