1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package jsr166y; |
572 |
|
if (p.casItem(item, e)) { // match |
573 |
|
for (Node q = p; q != h;) { |
574 |
|
Node n = q.next; // update by 2 unless singleton |
575 |
< |
if (head == h && casHead(h, n == null? q : n)) { |
575 |
> |
if (head == h && casHead(h, n == null ? q : n)) { |
576 |
|
h.forgetNext(); |
577 |
|
break; |
578 |
|
} // advance and retry |
797 |
|
lastPred = r; // next lastPred is old lastRet |
798 |
|
else if ((b = lastPred) == null || b.isMatched()) |
799 |
|
lastPred = null; // at start of list |
800 |
< |
else { |
800 |
> |
else { |
801 |
|
Node s, n; // help with removal of lastPred.next |
802 |
|
while ((s = b.next) != null && |
803 |
|
s != b && s.isMatched() && |
821 |
|
nextNode = s; |
822 |
|
return; |
823 |
|
} |
824 |
< |
} |
824 |
> |
} |
825 |
|
else if (item == null) |
826 |
|
break; |
827 |
|
// assert s.isMatched(); |