ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/ForkJoinPool.java
(Generate patch)

Comparing jsr166/src/jsr166y/ForkJoinPool.java (file contents):
Revision 1.70 by dl, Sat Sep 4 11:33:53 2010 UTC vs.
Revision 1.71 by jsr166, Mon Sep 6 21:36:43 2010 UTC

# Line 673 | Line 673 | public class ForkJoinPool extends Abstra
673      }
674  
675      /**
676 <     * Nulls out record of worker in workers array
676 >     * Nulls out record of worker in workers array.
677       */
678      private void forgetWorker(ForkJoinWorkerThread w) {
679          int idx = w.poolIndex;
# Line 1106 | Line 1106 | public class ForkJoinPool extends Abstra
1106                                       c = eventCount, c+1);
1107              eventWaiters = 0L; // clobber lists
1108              spareWaiters = 0;
1109 <            ForkJoinWorkerThread[] ws = workers;
1110 <            int n = ws.length;
1111 <            for (int i = 0; i < n; ++i) {
1112 <                ForkJoinWorkerThread w = ws[i];
1109 >            for (ForkJoinWorkerThread w : workers) {
1110                  if (w != null) {
1111                      w.shutdown();
1112                      if (passes > 0 && !w.isTerminated()) {
# Line 1526 | Line 1523 | public class ForkJoinPool extends Abstra
1523       */
1524      public long getQueuedTaskCount() {
1525          long count = 0;
1526 <        ForkJoinWorkerThread[] ws = workers;
1530 <        int n = ws.length;
1531 <        for (int i = 0; i < n; ++i) {
1532 <            ForkJoinWorkerThread w = ws[i];
1526 >        for (ForkJoinWorkerThread w : workers)
1527              if (w != null)
1528                  count += w.getQueueSize();
1535        }
1529          return count;
1530      }
1531  
# Line 1587 | Line 1580 | public class ForkJoinPool extends Abstra
1580       */
1581      protected int drainTasksTo(Collection<? super ForkJoinTask<?>> c) {
1582          int count = submissionQueue.drainTo(c);
1583 <        ForkJoinWorkerThread[] ws = workers;
1591 <        int n = ws.length;
1592 <        for (int i = 0; i < n; ++i) {
1593 <            ForkJoinWorkerThread w = ws[i];
1583 >        for (ForkJoinWorkerThread w : workers)
1584              if (w != null)
1585                  count += w.drainTasksTo(c);
1596        }
1586          return count;
1587      }
1588  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines