Lines Matching refs:head

56  * to any given producer.  The <em>head</em> of the queue is that
112 * It maintains two pointer fields, "head", pointing to a
119 * head tail
125 * overhead limitations when maintaining (via CAS) these head and
162 * updates on head/tail fields.
165 * never versus always updating queue (head and tail) pointers.
172 * head tail
178 * between the value of "head" and the first unmatched node, and
186 * virtue of only sometimes updating head or tail pointers when
208 * be further reduced without increasing contention of head
210 * path from the current "head" node to be closer to the currently
216 * links of nodes starting at old forgotten head nodes: As first
222 * this in our implementation, upon CASing to advance the head
223 * pointer, we set the "next" link of the previous head to point
229 * has lagged behind a head-update, and so the traversal must
230 * continue from the "head". Traversals trying to find the
232 * self-links, in which case they also continue at "head".
236 * cannot be done for head updates under the above link-forgetting
237 * mechanics because an update may leave head at a detached node.
250 * threshold of two -- that is, we update head/tail when the
267 * We allow both the head and tail fields to be null before any
289 * Starting at head, skip already-matched nodes until finding
292 * head to one past the matched node (or the node itself if the
294 * a loop retries advancing head by two steps until either
296 * attempt advances head by two (if applicable), we ensure that
298 * if the initial head is now off-list, in which case they
299 * start at the new head.
307 * and try to append a new node (or if head was null, establish
316 * by continuing the traversal at current head.
327 * it tries to unsplice any nodes between the current "head"
371 * from, the head of list.
398 * nodes become unlinked "naturally" as they fall off the head of
409 * some successor ultimately falls off the head of the list and is
478 * only after CASing head field, so uses relaxed write.
559 /** head of the queue; null until first enqueue */
560 transient volatile Node head;
607 for (Node h = head, p = h; p != null;) { // find & match first node
616 if (head == h && casHead(h, n == null ? q : n)) {
620 if ((h = head) == null ||
630 p = (p != n) ? n : (h = head); // Use head if p offlist
658 if (p == null && (p = head) == null) {
754 * Returns the successor of p, or the head node if p.next has been
760 return (p == next) ? head : next;
770 for (Node p = head; p != null;) {
792 for (Node p = head; p != null;) {
811 for (Node p = head; p != null;) {
840 for (Node p = head; p != null;) {
962 s = (p == null) ? head : p.next;
1132 * predecessor of s, or null or s itself if s is/was at head
1141 * nor s are head or offlist, add to sweepVotes, and if enough
1148 for (;;) { // check if at, or could be, head
1149 Node h = head;
1151 return; // at head or list empty
1158 h.forgetNext(); // advance head
1179 * traversal from head.
1182 for (Node p = head, s, n; p != null && (s = p.next) != null; ) {
1190 p = head;
1201 for (Node pred = null, p = head; p != null; ) {
1215 p = head;
1402 * The elements will be returned in order from first (head) to last (tail).
1415 for (Node p = head; p != null;) {
1443 for (Node p = head; p != null;) {
1503 for (Node p = head; p != null; p = succ(p)) {
1574 (LinkedTransferQueue.class.getDeclaredField("head"));