687 |
|
return (n >= 0) ? 0 : -n; // ignore transient negative |
688 |
|
} |
689 |
|
|
690 |
< |
/** |
690 |
> |
/** |
691 |
|
* Provides a more accurate estimate of whether this queue has |
692 |
|
* any tasks than does queueSize, by checking whether a |
693 |
|
* near-empty queue has at least one unclaimed task. |
725 |
|
} |
726 |
|
} |
727 |
|
|
728 |
< |
/** |
728 |
> |
/** |
729 |
|
* Initializes or doubles the capacity of array. Call either |
730 |
|
* by owner or with lock held -- it is OK for base, but not |
731 |
|
* top, to move while resizings are in progress. |
2127 |
|
w.runSubtask(t); |
2128 |
|
} |
2129 |
|
} |
2130 |
< |
else if (active) { // decrement active count without queuing |
2130 |
> |
else if (active) { // decrement active count without queuing |
2131 |
|
long nc = (c = ctl) - AC_UNIT; |
2132 |
|
if ((int)(nc >> AC_SHIFT) + (config & SMASK) == 0) |
2133 |
< |
return; // bypass decrement-then-increment |
2133 |
> |
return; // bypass decrement-then-increment |
2134 |
|
if (U.compareAndSwapLong(this, CTL, c, nc)) |
2135 |
|
active = false; |
2136 |
|
} |