ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentLinkedQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentLinkedQueue.java (file contents):
Revision 1.133 by jsr166, Wed Dec 7 23:50:38 2016 UTC vs.
Revision 1.134 by jsr166, Sat Dec 10 16:37:30 2016 UTC

# Line 132 | Line 132 | public class ConcurrentLinkedQueue<E> ex
132       * it is possible for tail to lag behind head (why not)?
133       *
134       * CASing a Node's item reference to null atomically removes the
135 <     * element from the queue.  Iterators and other traversal methods
136 <     * skip over Nodes with null items.  Prior implementations of this
137 <     * class had a race between poll() and remove(Object) where the
138 <     * same element would appear to be successfully removed by two
139 <     * concurrent operations.  Some traversal methods, including all
140 <     * interior removal methods other than via Iterator.remove, try to
141 <     * unlink any deleted Nodes encountered during traversal, but this
142 <     * is merely an optimization.  See comments in bulkRemove.
135 >     * element from the queue, leaving a "dead" node that should later
136 >     * be unlinked (but unlinking is merely an optimization).
137 >     * Interior element removal methods (other than Iterator.remove())
138 >     * keep track of the predecessor node during traversal so that the
139 >     * node can be CAS-unlinked.  Some traversal methods try to unlink
140 >     * any deleted nodes encountered during traversal.  See comments
141 >     * in bulkRemove.
142       *
143       * When constructing a Node (before enqueuing it) we avoid paying
144       * for a volatile write to item.  This allows the cost of enqueue

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines