Searched refs:head (Results 1 - 18 of 18) sorted by relevance

/libcore/ojluni/src/main/java/java/util/
H A DArrayDeque.java96 * thus avoiding head and tail wrapping around to equal each
103 * The index of the element at the head of the deque (which is the
107 transient int head; field in class:ArrayDeque
149 * when head and tail have wrapped around to become equal.
152 assert head == tail;
153 int p = head;
163 head = 0;
213 elements[head = (head - 1) & (elements.length - 1)] = e;
214 if (head
[all...]
H A DLinkedHashMap.java207 * (head, tail) rather than a pointer to a header node to maintain
226 * The head (eldest) of the doubly linked list.
228 transient LinkedHashMapEntry<K,V> head; field in class:LinkedHashMap
250 head = p;
263 head = dst;
276 head = tail = null;
312 head = a;
323 if (evict && (first = head) != null && removeEldestEntry(first)) {
336 head = a;
344 head
[all...]
/libcore/luni/src/main/java/java/lang/ref/
H A DFinalizerReference.java33 private static FinalizerReference<?> head = null; field in class:FinalizerReference
59 reference.next = head;
60 if (head != null) {
61 head.prev = reference;
63 head = reference;
76 head = next;
102 // We search the list for that FinalizerReference (it should be at or near the head),
104 for (FinalizerReference<?> r = head; r != null; r = r.next) {
/libcore/ojluni/src/main/java/java/lang/ref/
H A DReferenceQueue.java46 private Reference<? extends T> head = null; field in class:ReferenceQueue
84 head = r;
122 if (head != null) {
123 Reference<? extends T> r = head;
124 if (head == tail) {
126 head = null;
128 head = head.queueNext;
150 if (head == null)
/libcore/ojluni/src/main/java/java/util/concurrent/
H A DLinkedBlockingQueue.java57 * The <em>head</em> of the queue is that element that has been on the
62 * operations obtain elements at the head of the queue.
116 * self-link implicitly means to advance to head.next.
128 * - this Node, meaning the successor is head.next
144 * Invariant: head.item == null
146 transient Node<E> head; field in class:LinkedBlockingQueue
205 * Removes a node from head of queue.
211 // assert head.item == null;
212 Node<E> h = head;
215 head
[all...]
H A DArrayBlockingQueue.java57 * <em>head</em> of the queue is that element that has been on the
61 * operations obtain elements at the head of the queue.
710 * The elements will be returned in order from first (head) to last (tail).
728 * not at head) would cause iterators to sometimes lose their
790 private Node head; field in class:ArrayBlockingQueue.Itrs
812 // assert head != null;
820 p = head;
833 p = head;
845 head = next;
868 head
[all...]
H A DSynchronousQueue.java61 * <em>head</em> of the queue is the element that the first queued
164 * old head pointers), but references in Queue nodes must be
302 /** The head (top) of the stack */
303 volatile SNode head; field in class:SynchronousQueue.TransferStack
306 return h == head &&
314 * and CASes of head and to avoid surges of garbage when CASes
354 SNode h = head;
367 if ((h = head) != null && h.next == s)
422 * to be at the head of the stack, calls to park are
466 * Returns true if node s is at head o
595 transient volatile QNode head; field in class:SynchronousQueue.TransferQueue
[all...]
H A DPhaser.java971 AtomicReference<QNode> head = (phase & 1) == 0 ? evenQ : oddQ;
972 while ((q = head.get()) != null &&
974 if (head.compareAndSet(q, q.next) &&
986 * head of queue, which suffices to reduce memory footprint in
992 AtomicReference<QNode> head = (phase & 1) == 0 ? evenQ : oddQ;
995 QNode q = head.get();
999 if (head.compareAndSet(q, q.next) && t != null) {
1054 AtomicReference<QNode> head = (phase & 1) == 0 ? evenQ : oddQ;
1055 QNode q = node.next = head.get();
1058 queued = head
[all...]
H A DLinkedTransferQueue.java56 * 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
560 transient volatile Node head; field in class:LinkedTransferQueue
[all...]
H A DConcurrentLinkedQueue.java56 * The <em>head</em> of the queue is that element that has been on the
61 * operations obtain elements at the head of the queue.
128 * head as well.
130 * Nodes that are reachable from head. CASing the item
132 * queue. Reachability of all elements from head must remain
134 * head to advance. A dequeued Node may remain in use
148 * self-link implicitly means to advance to head.
150 * Both head and tail are permitted to lag. In fact, failing to
154 * that is, we update head/tail when the current pointer appears
157 * Since head an
220 transient volatile Node<E> head; field in class:ConcurrentLinkedQueue
[all...]
H A DConcurrentLinkedDeque.java148 * The deque object has two node references, "head" and "tail".
149 * The head and tail are only approximations to the first and last
151 * following prev pointers from head; likewise for tail. However,
152 * it is permissible for head and tail to be referring to deleted
184 * head or tail.
203 * the nodes pointed at by head/tail never get gc-unlinked, since
204 * head/tail are needed to get "back on track" by other nodes that
219 * pointers from head), and p.next == null && p.prev == p means
254 * - the first node is always O(1) reachable from head via prev links
256 * - head !
263 private transient volatile Node<E> head; field in class:ConcurrentLinkedDeque
[all...]
H A DConcurrentSkipListMap.java288 * tree-like structure) also uses CAS. The head index has initial
290 * than the current level adds a level to the head index by
291 * CAS'ing on a new top-most head. To maintain good performance
365 * The topmost head index of the skiplist.
367 private transient volatile HeadIndex<K,V> head; field in class:ConcurrentSkipListMap
396 head = new HeadIndex<K,V>(new Node<K,V>(null, BASE_HEADER, null),
401 * compareAndSet head node.
412 * headed by a dummy node accessible as head.node. The value field
435 * header node (head.node), which also has a null key.
667 for (Index<K,V> q = head,
[all...]
H A DScheduledThreadPoolExecutor.java540 Delayed head = (Delayed) super.getQueue().peek();
541 if (head != null) {
542 long headDelay = head.getDelay(NANOSECONDS);
882 * Thread designated to wait for the task at the head of the
890 * interim. Whenever the head of the queue is replaced with a
901 * head of the queue or a new thread may need to become leader.
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
H A DAbstractQueuedLongSynchronizer.java83 * If head exists, its waitStatus is guaranteed not to be
86 private transient volatile Node head; field in class:AbstractQueuedLongSynchronizer
187 * Sets head of queue to be node, thus dequeuing. Called only by
194 head = node;
234 * to calling unparkSuccessor of head if it needs signal.)
240 * way of trying to unparkSuccessor of head if it needs
249 Node h = head;
261 if (h == head) // loop if head changed
267 * Sets head o
[all...]
H A DAbstractQueuedSynchronizer.java320 * tail. To dequeue, you just set the head field.
323 * head | | <---- | | <---- | | tail
330 * involves only updating the "head". However, it takes a bit
364 * is constructed and head and tail pointers are set upon first
417 * nodes. This is set (for head node only) in
440 * because the head node is never cancelled: A node becomes
441 * head only as a result of successful acquire. A
502 /** Establishes initial head or SHARED marker. */
551 * If head exists, its waitStatus is guaranteed not to be
554 private transient volatile Node head; field in class:AbstractQueuedSynchronizer
[all...]
/libcore/luni/src/test/java/libcore/java/util/
H A DOldTreeMapTest.java213 Map head = tm.headMap("100");
214 assertEquals("Returned map of incorrect size", 3, head.size());
215 assertTrue("Returned incorrect elements", head.containsKey("0")
216 && head.containsValue(new Integer("1"))
217 && head.containsKey("10"));
262 assertTrue(head instanceof Serializable);
/libcore/ojluni/src/main/java/java/util/logging/
H A DLogManager.java888 String head;
890 head = name.substring(0, ix);
893 head = name;
899 LogNode child = node.children.get(head);
902 node.children.put(head, child);
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
H A DTreeMapTest.java294 Map head = tm.headMap("100");
295 assertEquals("Returned map of incorrect size", 3, head.size());
296 assertTrue("Returned incorrect elements", head.containsKey("0")
297 && head.containsValue(new Integer("1"))
298 && head.containsKey("10"));
322 assertTrue(head instanceof Serializable);
1589 // head map of head map

Completed in 299 milliseconds