[cvs] / jsr166 / src / main / java / util / concurrent / LinkedTransferQueue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/concurrent/LinkedTransferQueue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.72, Wed Oct 29 20:23:14 2014 UTC revision 1.73, Tue Nov 11 04:39:30 2014 UTC
# Line 790  Line 790 
790       * Used by methods size and getWaitingConsumerCount.       * Used by methods size and getWaitingConsumerCount.
791       */       */
792      private int countOfMode(boolean data) {      private int countOfMode(boolean data) {
793            restartFromHead: for (;;) {
794          int count = 0;          int count = 0;
795          for (Node p = head; p != null; ) {          for (Node p = head; p != null; ) {
796              if (!p.isMatched()) {              if (!p.isMatched()) {
797                  if (p.isData != data)                  if (p.isData != data)
798                      return 0;                      return 0;
799                  if (++count == Integer.MAX_VALUE) // saturated                      if (++count == Integer.MAX_VALUE)
800                      break;                          break;  // @see Collection.size()
             }  
             Node n = p.next;  
             if (n != p)  
                 p = n;  
             else {  
                 count = 0;  
                 p = head;  
801              }              }
802                    Node next = p.next;
803                    if (p == next)
804                        continue restartFromHead;
805                    p = next;
806          }          }
807          return count;          return count;
808      }      }
809        }
810    
811      final class Itr implements Iterator<E> {      final class Itr implements Iterator<E> {
812          private Node nextNode;   // next node to return item for          private Node nextNode;   // next node to return item for

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8