[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.27, Thu Sep 9 16:52:23 2010 UTC revision 1.28, Fri Sep 10 00:08:06 2010 UTC
# Line 880  Line 880 
880       */       */
881      private void sweep() {      private void sweep() {
882          for (Node p = head, s, n; p != null && (s = p.next) != null; ) {          for (Node p = head, s, n; p != null && (s = p.next) != null; ) {
883              if (p == s)                    // stale              if (!s.isMatched())
884                  p = head;                  // Unmatched nodes are never self-linked
             else if (!s.isMatched())  
885                  p = s;                  p = s;
886              else if ((n = s.next) == null || s == n) // trailing node is pinned              else if ((n = s.next) == null) // trailing node is pinned
887                  break;                  break;
888                else if (s == n)    // stale
889                    // No need to also check for p == s, since that implies s == n
890                    p = head;
891              else              else
892                  p.casNext(s, n);                  p.casNext(s, n);
893          }          }

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8