43 |
|
|
44 |
|
/** |
45 |
|
* Creates a thread pool that reuses a fixed set of threads |
46 |
< |
* operating off a shared unbounded queue. |
46 |
> |
* operating off a shared unbounded queue. If any thread |
47 |
> |
* terminates due to a failure during execution prior to shutdown, |
48 |
> |
* a new one will take its place if needed to execute subsequent |
49 |
> |
* tasks. |
50 |
|
* |
51 |
|
* @param nThreads the number of threads in the pool |
52 |
|
* @return the newly created thread pool |
82 |
|
* shutdown, a new one will take its place if needed to execute |
83 |
|
* subsequent tasks.) Tasks are guaranteed to execute |
84 |
|
* sequentially, and no more than one task will be active at any |
85 |
< |
* given time. |
85 |
> |
* given time. This method is equivalent in effect to |
86 |
> |
*<tt>new FixedThreadPool(1)</tt>. |
87 |
|
* |
88 |
|
* @return the newly-created single-threaded Executor |
89 |
|
*/ |
121 |
|
* thread will be created and added to the pool. Threads that have |
122 |
|
* not been used for sixty seconds are terminated and removed from |
123 |
|
* the cache. Thus, a pool that remains idle for long enough will |
124 |
< |
* not consume any resources. |
124 |
> |
* not consume any resources. Note that pools with similar |
125 |
> |
* properties but different details (for example, timeout parameters) |
126 |
> |
* may be created using {@link ThreadPoolExecutor} constructors. |
127 |
|
* |
128 |
|
* @return the newly created thread pool |
129 |
|
*/ |