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.37 by dl, Thu Dec 4 20:54:29 2003 UTC vs.
Revision 1.38 by tim, Wed Dec 10 01:51:11 2003 UTC

# Line 223 | Line 223 | import java.util.*;
223   * @since 1.5
224   * @author Doug Lea
225   */
226 < public class ThreadPoolExecutor implements ExecutorService {
226 > public class ThreadPoolExecutor extends AbstractExecutorService {
227      /**
228       * Queue used for holding tasks and handing off to worker threads.
229       */
# Line 1030 | Line 1030 | public class ThreadPoolExecutor implemen
1030          try {
1031              int extra = this.corePoolSize - corePoolSize;
1032              this.corePoolSize = corePoolSize;
1033 <            if (extra < 0) {
1034 <                Runnable r;
1035 <                while (extra++ < 0 && poolSize < corePoolSize &&
1036 <                       (r = workQueue.poll()) != null)
1037 <                    addThread(r).start();
1038 <            }
1039 <            else if (extra > 0 && poolSize > corePoolSize) {
1033 >            if (extra < 0) {
1034 >                Runnable r;
1035 >                while (extra++ < 0 && poolSize < corePoolSize &&
1036 >                       (r = workQueue.poll()) != null)
1037 >                    addThread(r).start();
1038 >            }
1039 >            else if (extra > 0 && poolSize > corePoolSize) {
1040                  Iterator<Worker> it = workers.iterator();
1041                  while (it.hasNext() &&
1042                         extra-- > 0 &&

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines