ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/ConcurrentHashMapV8.java
(Generate patch)

Comparing jsr166/src/jsr166e/ConcurrentHashMapV8.java (file contents):
Revision 1.117 by dl, Sun Dec 1 13:39:02 2013 UTC vs.
Revision 1.118 by dl, Sun Dec 1 16:08:12 2013 UTC

# Line 2732 | Line 2732 | public class ConcurrentHashMapV8<K,V> ex
2732           * using tree comparisons from root, but continues linear
2733           * search when lock not available.
2734           */
2735 < final Node<K,V> find(int h, Object k) {
2735 >        final Node<K,V> find(int h, Object k) {
2736              if (k != null) {
2737 <                for (Node<K,V> e = first; e != null; e = e.next) {
2737 >                for (Node<K,V> e = first; e != null; ) {
2738                      int s; K ek;
2739                      if (((s = lockState) & (WAITER|WRITER)) != 0) {
2740                          if (e.hash == h &&
2741                              ((ek = e.key) == k || (ek != null && k.equals(ek))))
2742                              return e;
2743 +                        e = e.next;
2744                      }
2745                      else if (U.compareAndSwapInt(this, LOCKSTATE, s,
2746                                                   s + READER)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines