97 |
|
* TimeUnit)}. Using a value of {@code Long.MAX_VALUE} {@link |
98 |
|
* TimeUnit#NANOSECONDS} effectively disables idle threads from ever |
99 |
|
* terminating prior to shut down. By default, the keep-alive policy |
100 |
< |
* applies only when there are more than corePoolSize threads. But |
100 |
> |
* applies only when there are more than corePoolSize threads, but |
101 |
|
* method {@link #allowCoreThreadTimeOut(boolean)} can be used to |
102 |
|
* apply this time-out policy to core threads as well, so long as the |
103 |
|
* keepAliveTime value is non-zero. </dd> |
1649 |
|
} |
1650 |
|
|
1651 |
|
/** |
1652 |
< |
* Sets the time limit for which threads may remain idle before |
1653 |
< |
* being terminated. If there are more than the core number of |
1654 |
< |
* threads currently in the pool, after waiting this amount of |
1655 |
< |
* time without processing a task, excess threads will be |
1656 |
< |
* terminated. This overrides any value set in the constructor. |
1652 |
> |
* Sets the thread keep-alive time, which is the amount of time |
1653 |
> |
* that threads may remain idle before being terminated. |
1654 |
> |
* Threads that wait this amount of time without processing a |
1655 |
> |
* task will be terminated if there are more than the core |
1656 |
> |
* number of threads currently in the pool, or if this pool |
1657 |
> |
* {@linkplain #allowsCoreThreadTimeOut() allows core thread timeout}. |
1658 |
> |
* This overrides any value set in the constructor. |
1659 |
|
* |
1660 |
|
* @param time the time to wait. A time value of zero will cause |
1661 |
|
* excess threads to terminate immediately after executing tasks. |
1678 |
|
|
1679 |
|
/** |
1680 |
|
* Returns the thread keep-alive time, which is the amount of time |
1681 |
< |
* that threads in excess of the core pool size may remain |
1682 |
< |
* idle before being terminated. |
1681 |
> |
* that threads may remain idle before being terminated. |
1682 |
> |
* Threads that wait this amount of time without processing a |
1683 |
> |
* task will be terminated if there are more than the core |
1684 |
> |
* number of threads currently in the pool, or if this pool |
1685 |
> |
* {@linkplain #allowsCoreThreadTimeOut() allows core thread timeout}. |
1686 |
|
* |
1687 |
|
* @param unit the desired time unit of the result |
1688 |
|
* @return the time limit |