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 |
|
} |
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 |
|
/** |