ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ThreadPoolExecutor.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ThreadPoolExecutor.java (file contents):
Revision 1.40 by tim, Wed Dec 10 14:52:01 2003 UTC vs.
Revision 1.41 by tim, Wed Dec 10 14:57:13 2003 UTC

# Line 225 | Line 225 | import java.util.*;
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;
# Line 308 | Line 313 | public class ThreadPoolExecutor extends
313       * worker threads.
314       */
315      private long completedTaskCount;
316 <
316 >    
317      /**
318       * The default rejected execution handler
319       */
# Line 862 | Line 867 | public class ThreadPoolExecutor extends
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() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines