225 |
|
*/ |
226 |
|
public class ThreadPoolExecutor extends AbstractExecutorService { |
227 |
|
/** |
228 |
+ |
* Only used to force toArray() to produce a Runnable[]. |
229 |
+ |
*/ |
230 |
+ |
private static final Runnable[] EMPTY_RUNNABLE_ARRAY = new Runnable[0]; |
231 |
+ |
|
232 |
+ |
/** |
233 |
|
* Queue used for holding tasks and handing off to worker threads. |
234 |
|
*/ |
235 |
|
private final BlockingQueue<Runnable> workQueue; |
313 |
|
* worker threads. |
314 |
|
*/ |
315 |
|
private long completedTaskCount; |
316 |
< |
|
316 |
> |
|
317 |
|
/** |
318 |
|
* The default rejected execution handler |
319 |
|
*/ |
867 |
|
if (fullyTerminated) |
868 |
|
terminated(); |
869 |
|
|
870 |
< |
return Arrays.asList(workQueue.toArray(new Runnable[0])); |
870 |
> |
return Arrays.asList(workQueue.toArray(EMPTY_RUNNABLE_ARRAY)); |
871 |
|
} |
872 |
|
|
873 |
|
public boolean isShutdown() { |