5 |
|
*/ |
6 |
|
|
7 |
|
package java.util.concurrent; |
8 |
< |
import java.util.concurrent.*; // for javadoc |
8 |
> |
import java.util.concurrent.*; // for javadoc (till 6280605 is fixed) |
9 |
|
import java.util.*; |
10 |
|
import java.util.concurrent.atomic.AtomicInteger; |
11 |
|
import java.security.AccessControlContext; |
42 |
|
|
43 |
|
/** |
44 |
|
* Creates a thread pool that reuses a fixed number of threads |
45 |
< |
* operating off a shared unbounded queue. At any point, at most |
46 |
< |
* <tt>nThreads</tt> threads will be active processing tasks. If |
47 |
< |
* additional tasks are submitted when all threads are active, |
48 |
< |
* they will wait in the queue until a thread is available. If |
49 |
< |
* any thread terminates due to a failure during execution prior |
50 |
< |
* to shutdown, a new one will take its place if needed to execute |
51 |
< |
* subsequent tasks. |
45 |
> |
* operating off a shared unbounded queue. At any point, at most |
46 |
> |
* <tt>nThreads</tt> threads will be active processing tasks. |
47 |
> |
* If additional tasks are submitted when all threads are active, |
48 |
> |
* they will wait in the queue until a thread is available. |
49 |
> |
* If any thread terminates due to a failure during execution |
50 |
> |
* prior to shutdown, a new one will take its place if needed to |
51 |
> |
* execute subsequent tasks. |
52 |
|
* |
53 |
|
* @param nThreads the number of threads in the pool |
54 |
|
* @return the newly created thread pool |
64 |
|
* operating off a shared unbounded queue, using the provided |
65 |
|
* ThreadFactory to create new threads when needed. At any point, |
66 |
|
* at most <tt>nThreads</tt> threads will be active processing |
67 |
< |
* tasks. If additional tasks are submitted when all threads are |
67 |
> |
* tasks. If additional tasks are submitted when all threads are |
68 |
|
* active, they will wait in the queue until a thread is |
69 |
< |
* available. If any thread terminates due to a failure during |
69 |
> |
* available. If any thread terminates due to a failure during |
70 |
|
* execution prior to shutdown, a new one will take its place if |
71 |
|
* needed to execute subsequent tasks. |
72 |
|
* |