ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.315 by dl, Wed Nov 28 23:52:49 2018 UTC vs.
Revision 1.316 by dl, Sun Dec 2 16:00:41 2018 UTC

# Line 2305 | Line 2305 | public class ConcurrentHashMap<K,V> exte
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              }
# Line 2329 | Line 2327 | public class ConcurrentHashMap<K,V> exte
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines