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 |