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.298 by jsr166, Wed Mar 8 22:05:14 2017 UTC vs.
Revision 1.299 by jsr166, Sat Mar 18 19:19:04 2017 UTC

# Line 1003 | Line 1003 | public class ConcurrentHashMap<K,V> exte
1003              }
1004              else if ((fh = f.hash) == MOVED)
1005                  tab = helpTransfer(tab, f);
1006 <            else if (onlyIfAbsent && fh == hash &&  // check first node
1007 <                     ((fk = f.key) == key || fk != null && key.equals(fk)) &&
1008 <                     (fv = f.val) != null)
1006 >            else if (onlyIfAbsent // check first node without acquiring lock
1007 >                     && fh == hash
1008 >                     && ((fk = f.key) == key || (fk != null && key.equals(fk)))
1009 >                     && (fv = f.val) != null)
1010                  return fv;
1011              else {
1012                  V oldVal = null;
# Line 1699 | Line 1700 | public class ConcurrentHashMap<K,V> exte
1700              }
1701              else if ((fh = f.hash) == MOVED)
1702                  tab = helpTransfer(tab, f);
1703 <            else if (fh == h &&                  // check first node
1704 <                     ((fk = f.key) == key || fk != null && key.equals(fk)) &&
1705 <                     (fv = f.val) != null)
1703 >            else if (fh == h    // check first node without acquiring lock
1704 >                     && ((fk = f.key) == key || (fk != null && key.equals(fk)))
1705 >                     && (fv = f.val) != null)
1706                  return fv;
1707              else {
1708                  boolean added = false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines