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 jsr166x; |
524 |
|
* Variant of removeFirstOccurrence needed by iterator.remove. |
525 |
|
* Searches for the node, not its contents. |
526 |
|
*/ |
527 |
< |
boolean removeNode(Node<E> e) { |
527 |
> |
boolean removeNode(Node<E> e) { |
528 |
|
lock.lock(); |
529 |
|
try { |
530 |
|
for (Node<E> p = first; p != null; p = p.next) { |
684 |
|
final ReentrantLock lock = LinkedBlockingDeque.this.lock; |
685 |
|
lock.lock(); |
686 |
|
try { |
687 |
< |
next = (next == null)? first : next.next; |
688 |
< |
nextItem = (next == null)? null : next.item; |
687 |
> |
next = (next == null) ? first : next.next; |
688 |
> |
nextItem = (next == null) ? null : next.item; |
689 |
|
} finally { |
690 |
|
lock.unlock(); |
691 |
|
} |