[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.19, Sun Nov 15 02:29:13 2009 UTC revision 1.20, Mon Nov 16 01:02:49 2009 UTC
# Line 877  Line 877 
877       * Unlinks matched nodes encountered in a traversal from head.       * Unlinks matched nodes encountered in a traversal from head.
878       */       */
879      private void sweep() {      private void sweep() {
880          Node p = head, s, n;          for (Node p = head, s, n; p != null && (s = p.next) != null; ) {
881          while (p != null && (s = p.next) != null && (n = s.next) != null) {              if (p == s)                    // stale
882              if (p == s || s == n)                  p = head;
883                  p = head; // stale              else if (!s.isMatched())
             else if (s.isMatched())  
                 p.casNext(s, n);  
             else  
884                  p = s;                  p = s;
885                else if ((n = s.next) == null) // trailing node is pinned
886                    break;
887                else
888                    p.casNext(s, n);
889          }          }
890      }      }
891    

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8