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.82 by dl, Thu Dec 13 20:34:00 2012 UTC vs.
Revision 1.83 by jsr166, Fri Dec 14 16:33:42 2012 UTC

# Line 1261 | Line 1261 | public class ConcurrentHashMapV8<K, V>
1261              else {
1262                  boolean validated = false;
1263                  boolean deleted = false;
1264 <                synchronized(f) {
1264 >                synchronized (f) {
1265                      if (tabAt(tab, i) == f) {
1266                          validated = true;
1267                          for (Node e = f, pred = null;;) {
# Line 1362 | Line 1362 | public class ConcurrentHashMapV8<K, V>
1362                  return (V)fv;
1363              else {
1364                  Object oldVal = null;
1365 <                synchronized(f) {
1365 >                synchronized (f) {
1366                      if (tabAt(tab, i) == f) {
1367                          len = 1;
1368                          for (Node e = f;; ++len) {
# Line 1410 | Line 1410 | public class ConcurrentHashMapV8<K, V>
1410                  tab = initTable();
1411              else if ((f = tabAt(tab, i = (tab.length - 1) & h)) == null) {
1412                  Node node = new Node(h, k, null, null);
1413 <                synchronized(node) {
1413 >                synchronized (node) {
1414                      if (casTabAt(tab, i, null, node)) {
1415                          len = 1;
1416                          try {
# Line 1462 | Line 1462 | public class ConcurrentHashMapV8<K, V>
1462                          return (V)ev;
1463                  }
1464                  boolean added = false;
1465 <                synchronized(f) {
1465 >                synchronized (f) {
1466                      if (tabAt(tab, i) == f) {
1467                          len = 1;
1468                          for (Node e = f;; ++len) {
# Line 1516 | Line 1516 | public class ConcurrentHashMapV8<K, V>
1516                  if (onlyIfPresent)
1517                      break;
1518                  Node node = new Node(h, k, null, null);
1519 <                synchronized(node) {
1519 >                synchronized (node) {
1520                      if (casTabAt(tab, i, null, node)) {
1521                          try {
1522                              len = 1;
# Line 1568 | Line 1568 | public class ConcurrentHashMapV8<K, V>
1568                      tab = (Node[])fk;
1569              }
1570              else {
1571 <                synchronized(f) {
1571 >                synchronized (f) {
1572                      if (tabAt(tab, i) == f) {
1573                          len = 1;
1574                          for (Node e = f, pred = null;; ++len) {
# Line 1665 | Line 1665 | public class ConcurrentHashMapV8<K, V>
1665                      tab = (Node[])fk;
1666              }
1667              else {
1668 <                synchronized(f) {
1668 >                synchronized (f) {
1669                      if (tabAt(tab, i) == f) {
1670                          len = 1;
1671                          for (Node e = f, pred = null;; ++len) {
# Line 1758 | Line 1758 | public class ConcurrentHashMapV8<K, V>
1758                      }
1759                      else {
1760                          int len = 0;
1761 <                        synchronized(f) {
1761 >                        synchronized (f) {
1762                              if (tabAt(tab, i) == f) {
1763                                  len = 1;
1764                                  for (Node e = f;; ++len) {
# Line 1833 | Line 1833 | public class ConcurrentHashMapV8<K, V>
1833                      tab = (Node[])fk;
1834              }
1835              else {
1836 <                synchronized(f) {
1836 >                synchronized (f) {
1837                      if (tabAt(tab, i) == f) {
1838                          for (Node e = f; e != null; e = e.next) {
1839                              if (e.val != null) {  // (currently always true)
# Line 1980 | Line 1980 | public class ConcurrentHashMapV8<K, V>
1980          if (nextTab == null) {            // initiating
1981              try {
1982                  nextTab = new Node[n << 1];
1983 <            } catch(Throwable ex) {       // try to cope with OOME
1983 >            } catch (Throwable ex) {      // try to cope with OOME
1984                  sizeCtl = Integer.MAX_VALUE;
1985                  return;
1986              }
# Line 1989 | Line 1989 | public class ConcurrentHashMapV8<K, V>
1989              transferIndex = n;
1990              Node rev = new Node(MOVED, tab, null, null);
1991              for (int k = n; k > 0;) {    // progressively reveal ready slots
1992 <                int nextk = k > stride? k - stride : 0;
1992 >                int nextk = (k > stride) ? k - stride : 0;
1993                  for (int m = nextk; m < k; ++m)
1994                      nextTab[m] = rev;
1995                  for (int m = n + nextk; m < n + k; ++m)
# Line 2011 | Line 2011 | public class ConcurrentHashMapV8<K, V>
2011                  }
2012                  else if (U.compareAndSwapInt
2013                           (this, TRANSFERINDEX, nextIndex,
2014 <                          nextBound = (nextIndex > stride?
2014 >                          nextBound = (nextIndex > stride ?
2015                                         nextIndex - stride : 0))) {
2016                      bound = nextBound;
2017                      i = nextIndex - 1;
# Line 2038 | Line 2038 | public class ConcurrentHashMapV8<K, V>
2038                  }
2039              }
2040              else if (f.hash >= 0) {
2041 <                synchronized(f) {
2041 >                synchronized (f) {
2042                      if (tabAt(tab, i) == f) {
2043                          int runBit = f.hash & n;
2044                          Node lastRun = f, lo = null, hi = null;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines