@@ -2334,17 +2334,15 @@ private final void addCount(long x, int check) {
2334
2334
Node <K ,V >[] tab , nt ; int n , sc ;
2335
2335
while (s >= (long )(sc = sizeCtl ) && (tab = table ) != null &&
2336
2336
(n = tab .length ) < MAXIMUM_CAPACITY ) {
2337
- int rs = resizeStamp (n );
2337
+ int rs = resizeStamp (n ) << RESIZE_STAMP_SHIFT ;
2338
2338
if (sc < 0 ) {
2339
- if ((sc >>> RESIZE_STAMP_SHIFT ) != rs || sc == rs + 1 ||
2340
- sc == rs + MAX_RESIZERS || (nt = nextTable ) == null ||
2341
- transferIndex <= 0 )
2339
+ if (sc == rs + MAX_RESIZERS || sc == rs + 1 ||
2340
+ (nt = nextTable ) == null || transferIndex <= 0 )
2342
2341
break ;
2343
2342
if (U .compareAndSetInt (this , SIZECTL , sc , sc + 1 ))
2344
2343
transfer (tab , nt );
2345
2344
}
2346
- else if (U .compareAndSetInt (this , SIZECTL , sc ,
2347
- (rs << RESIZE_STAMP_SHIFT ) + 2 ))
2345
+ else if (U .compareAndSetInt (this , SIZECTL , sc , rs + 2 ))
2348
2346
transfer (tab , null );
2349
2347
s = sumCount ();
2350
2348
}
@@ -2358,11 +2356,11 @@ final Node<K,V>[] helpTransfer(Node<K,V>[] tab, Node<K,V> f) {
2358
2356
Node <K ,V >[] nextTab ; int sc ;
2359
2357
if (tab != null && (f instanceof ForwardingNode ) &&
2360
2358
(nextTab = ((ForwardingNode <K ,V >)f ).nextTable ) != null ) {
2361
- int rs = resizeStamp (tab .length );
2359
+ int rs = resizeStamp (tab .length ) << RESIZE_STAMP_SHIFT ;
2362
2360
while (nextTab == nextTable && table == tab &&
2363
2361
(sc = sizeCtl ) < 0 ) {
2364
- if (( sc >>> RESIZE_STAMP_SHIFT ) != rs || sc == rs + 1 ||
2365
- sc == rs + MAX_RESIZERS || transferIndex <= 0 )
2362
+ if (sc == rs + MAX_RESIZERS || sc == rs + 1 ||
2363
+ transferIndex <= 0 )
2366
2364
break ;
2367
2365
if (U .compareAndSetInt (this , SIZECTL , sc , sc + 1 )) {
2368
2366
transfer (tab , nextTab );
0 commit comments