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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinPool.java (file contents):
Revision 1.28 by jsr166, Wed Sep 1 20:12:39 2010 UTC vs.
Revision 1.29 by jsr166, Mon Sep 6 21:36:44 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines