2305 |
|
Node<K,V>[] tab, nt; int n, sc; |
2306 |
|
while (s >= (long)(sc = sizeCtl) && (tab = table) != null && |
2307 |
|
(n = tab.length) < MAXIMUM_CAPACITY) { |
2308 |
< |
int rs = resizeStamp(n); |
2308 |
> |
int rs = resizeStamp(n) << RESIZE_STAMP_SHIFT; |
2309 |
|
if (sc < 0) { |
2310 |
< |
if ((sc >>> RESIZE_STAMP_SHIFT) == rs + 1 || |
2311 |
< |
(sc >>> RESIZE_STAMP_SHIFT) == rs + MAX_RESIZERS || |
2310 |
> |
if (sc == rs + MAX_RESIZERS || sc == rs + 1 || |
2311 |
|
(nt = nextTable) == null || transferIndex <= 0) |
2312 |
|
break; |
2313 |
|
if (U.compareAndSetInt(this, SIZECTL, sc, sc + 1)) |
2314 |
|
transfer(tab, nt); |
2315 |
|
} |
2316 |
< |
else if (U.compareAndSetInt(this, SIZECTL, sc, |
2318 |
< |
(rs << RESIZE_STAMP_SHIFT) + 2)) |
2316 |
> |
else if (U.compareAndSetInt(this, SIZECTL, sc, rs + 2)) |
2317 |
|
transfer(tab, null); |
2318 |
|
s = sumCount(); |
2319 |
|
} |
2327 |
|
Node<K,V>[] nextTab; int sc; |
2328 |
|
if (tab != null && (f instanceof ForwardingNode) && |
2329 |
|
(nextTab = ((ForwardingNode<K,V>)f).nextTable) != null) { |
2330 |
< |
int rs = resizeStamp(tab.length); |
2330 |
> |
int rs = resizeStamp(tab.length) << RESIZE_STAMP_SHIFT; |
2331 |
|
while (nextTab == nextTable && table == tab && |
2332 |
|
(sc = sizeCtl) < 0) { |
2333 |
< |
if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 || |
2334 |
< |
sc == rs + MAX_RESIZERS || transferIndex <= 0) |
2333 |
> |
if (sc == rs + MAX_RESIZERS || sc == rs + 1 || |
2334 |
> |
transferIndex <= 0) |
2335 |
|
break; |
2336 |
|
if (U.compareAndSetInt(this, SIZECTL, sc, sc + 1)) { |
2337 |
|
transfer(tab, nextTab); |