733 |
|
|
734 |
|
/** |
735 |
|
* Returns the first unmatched node of the given mode, or null if |
736 |
< |
* none. Used by methods isEmpty, hasWaitingConsumer. |
736 |
> |
* none. Used by hasWaitingConsumer. |
737 |
|
*/ |
738 |
|
private Node firstOfMode(boolean isData) { |
739 |
|
for (Node p = head; p != null; p = succ(p)) { |
1426 |
|
* @return {@code true} if this queue contains no elements |
1427 |
|
*/ |
1428 |
|
public boolean isEmpty() { |
1429 |
< |
for (Node p = head; p != null; p = succ(p)) { |
1430 |
< |
if (!p.isMatched()) |
1431 |
< |
return !p.isData; |
1432 |
< |
} |
1433 |
< |
return true; |
1429 |
> |
return firstDataNode() == null; |
1430 |
|
} |
1431 |
|
|
1432 |
|
public boolean hasWaitingConsumer() { |