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.291 by jsr166, Sun Oct 11 04:27:44 2015 UTC vs.
Revision 1.292 by dl, Sun Oct 11 14:31:39 2015 UTC

# Line 836 | Line 836 | public class ForkJoinPool extends Abstra
836           */
837          final void push(ForkJoinTask<?> task) {
838              U.storeFence();              // ensure safe publication
839 <            int b = base, s = top, al, d; ForkJoinTask<?>[] a;
839 >            int s = top, al, d; ForkJoinTask<?>[] a;
840              if ((a = array) != null && (al = a.length) > 0) {
841                  a[(al - 1) & s] = task;  // relaxed writes OK
842                  top = s + 1;
843                  ForkJoinPool p = pool;
844 <                if ((d = b - s) == 0 && p != null) {
844 >                if ((d = base - s) == 0 && p != null) {
845                      U.fullFence();
846                      p.signalWork();
847                  }
# Line 960 | Line 960 | public class ForkJoinPool extends Abstra
960           * Returns next task, if one exists, in order specified by mode.
961           */
962          final ForkJoinTask<?> peek() {
963 <            int b = base, al; ForkJoinTask<?>[] a;
963 >            int al; ForkJoinTask<?>[] a;
964              return ((a = array) != null && (al = a.length) > 0) ?
965 <                a[(al - 1) & (config < 0 ? b : top - 1)] : null;
965 >                a[(al - 1) & (config < 0 ? base : top - 1)] : null;
966          }
967  
968          /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines