Searched refs:queue (Results 1 - 25 of 30) sorted by relevance

12

/libcore/ojluni/src/main/java/java/util/
H A DTimer.java79 * it uses a binary heap to represent its task queue, so the cost to schedule
92 * The timer task queue. This data structure is shared with the timer
95 * and removing them from the queue when they're obsolete.
101 private final TaskQueue queue = new TaskQueue(); field in class:Timer
108 private final TimerThread thread = new TimerThread(queue);
113 * tasks in the timer queue. It is used in preference to a finalizer on
119 synchronized(queue) {
121 queue.notify(); // In case queue is empty.
402 synchronized(queue) {
504 private TaskQueue queue; field in class:TimerThread
506 TimerThread(TaskQueue queue) argument
585 private TimerTask[] queue = new TimerTask[128]; field in class:TaskQueue
[all...]
H A DPriorityQueue.java31 * An unbounded priority {@linkplain Queue queue} based on a priority heap.
32 * The elements of the priority queue are ordered according to their
34 * provided at queue construction time, depending on which constructor is
35 * used. A priority queue does not permit {@code null} elements.
36 * A priority queue relying on natural ordering also does not permit
40 * <p>The <em>head</em> of this queue is the <em>least</em> element
43 * broken arbitrarily. The queue retrieval operations {@code poll},
45 * element at the head of the queue.
47 * <p>A priority queue is unbounded, but has an internal
49 * elements on the queue
97 transient Object[] queue; // non-private to simplify nested class access field in class:PriorityQueue
[all...]
H A DWeakHashMap.java178 * Reference queue for cleared WeakEntries
180 private final ReferenceQueue<Object> queue = new ReferenceQueue<>(); field in class:WeakHashMap
318 for (Object x; (x = queue.poll()) != null; ) {
319 synchronized (queue) {
464 tab[i] = new Entry<>(k, value, queue, h, e);
497 * If ignoring null elements and processing ref queue caused massive
650 // clear out ref queue. We don't need to expunge entries
652 while (queue.poll() != null)
661 // reference queue will make them eligible for reclamation.
662 while (queue
710 Entry(Object key, V value, ReferenceQueue<Object> queue, int hash, Entry<K,V> next) argument
[all...]
/libcore/ojluni/src/main/java/java/lang/ref/
H A DReference.java65 final ReferenceQueue<? super T> queue; field in class:Reference
71 * before it has been removed from its queue, the queueNext field points
72 * to the next reference on the queue. The last reference on a queue
74 * reference queue, the queueNext field points to the
79 * internal to 'queue'.
130 * not registered with a queue when it was created, then this method will
138 // after this reference object has been removed from its queue
141 return queue != null && queue
166 Reference(T referent, ReferenceQueue<? super T> queue) argument
[all...]
H A DReferenceQueue.java41 // when a reference has been enqueued and removed from its queue.
44 // NOTE: This implementation of ReferenceQueue is FIFO (queue-like) whereas
52 * Constructs a new reference-object queue.
57 * Enqueue the given reference onto this queue.
58 * The caller is responsible for ensuring the lock is held on this queue,
59 * and for calling notifyAll on this queue after the reference has been
72 // of enqueueing it in the queue. Cleaners are associated with dummy queues that
78 // enqueued, but is now removed from the queue.
95 * removed from the queue, assuming this is the reference object's queue
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
H A DAbstractQueueTest.java31 private MockAbstractQueue<Object> queue; field in class:AbstractQueueTest
113 queue.add(null);
127 queue.add(o);
131 queue.add(o);
145 queue.add(o);
148 queue.add(I);
149 assertTrue(queue.contains(I));
150 Iterator iter = queue.iterator();
162 queue.addAll(null);
175 queue
[all...]
H A DPriorityQueueTest.java198 PriorityQueue<Object> queue = new PriorityQueue<Object>();
199 assertNotNull(queue);
200 assertEquals(0, queue.size());
201 assertNull(queue.comparator());
208 PriorityQueue<Object> queue = new PriorityQueue<Object>(100);
209 assertNotNull(queue);
210 assertEquals(0, queue.size());
211 assertNull(queue.comparator());
218 PriorityQueue<Object> queue = new PriorityQueue<Object>(100,
220 assertNotNull(queue);
[all...]
/libcore/benchmarks/src/benchmarks/
H A DReferenceBenchmark.java34 ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
36 new PhantomReference(object, queue);
42 ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
44 (new PhantomReference<Object>(object, queue)).enqueue();
50 ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
52 (new PhantomReference<Object>(object, queue)).enqueue();
55 queue.poll();
61 ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
63 (new PhantomReference<Object>(object, queue)).enqueue();
67 queue
[all...]
/libcore/luni/src/test/java/libcore/java/util/
H A DOldPriorityQueueTest.java28 PriorityQueue<Object> queue = new PriorityQueue<Object>(100);
29 assertNotNull(queue);
30 assertEquals(0, queue.size());
31 assertNull(queue.comparator());
42 PriorityQueue<String> queue = new PriorityQueue<String>(10,
46 queue.offer(array[i]);
48 assertFalse(queue.contains("BB"));
51 assertFalse(queue.remove("BB"));
52 assertTrue(queue.remove("AA"));
H A DCollectionsTest.java430 Queue queue = checkedQueue(new LinkedBlockingDeque<>(2), CharSequence.class);
431 assertQueueEmpty(queue);
435 assertTrue(queue.add(firstElement));
436 assertFalse(queue.isEmpty());
437 assertTrue(queue.add("second element"));
438 assertEquals(2, queue.size());
440 assertFalse(queue.offer("third element")); // queue is at capacity
442 queue.add("third element");
446 assertThrowsCce(() -> { queue
463 assertQueueEmpty(Queue queue) argument
[all...]
/libcore/ojluni/src/main/java/java/util/concurrent/
H A DScheduledThreadPoolExecutor.java71 * automatically removed from the work queue until its delay elapses.
86 * {@code corePoolSize} threads and an unbounded queue, adjustments
142 * 2. Using a custom queue (DelayedWorkQueue), a variant of
171 * True if ScheduledFutureTask.cancel should remove from queue.
202 * Index into delay queue, to support faster cancellation.
323 * is shut down, rejects the task. Otherwise adds task to queue
363 * Cancels and clears the queue of all tasks that should not be run
484 * because the thread bounds and queue capacities are reached
504 * because the thread bounds and queue capacities are reached
533 * Constrains the values of all delays in the queue t
876 private RunnableScheduledFuture<?>[] queue = field in class:ScheduledThreadPoolExecutor.DelayedWorkQueue
[all...]
H A DPriorityBlockingQueue.java57 * An unbounded {@linkplain BlockingQueue blocking queue} that uses
59 * blocking retrieval operations. While this queue is logically
62 * {@code null} elements. A priority queue relying on {@linkplain
106 * @param <E> the type of elements held in this queue
143 * Priority queue represented as a balanced binary heap: the two
144 * children of queue[n] are queue[2*n+1] and queue[2*(n+1)]. The
145 * priority queue is ordered by comparator, or by the elements'
148 * lowest value is in queue[
150 private transient Object[] queue; field in class:PriorityBlockingQueue
936 final PriorityBlockingQueue<E> queue; field in class:PriorityBlockingQueue.PBQSpliterator
941 PBQSpliterator(PriorityBlockingQueue<E> queue, Object[] array, int index, int fence) argument
[all...]
H A DLinkedBlockingQueue.java54 * An optionally-bounded {@linkplain BlockingQueue blocking queue} based on
56 * This queue orders elements FIFO (first-in-first-out).
57 * The <em>head</em> of the queue is that element that has been on the
58 * queue the longest time.
59 * The <em>tail</em> of the queue is that element that has been on the
60 * queue the shortest time. New elements
61 * are inserted at the tail of the queue, and the queue retrieval
62 * operations obtain elements at the head of the queue.
67 * way to prevent excessive queue expansio
831 final LinkedBlockingQueue<E> queue; field in class:LinkedBlockingQueue.LBQSpliterator
836 LBQSpliterator(LinkedBlockingQueue<E> queue) argument
[all...]
H A DConcurrentLinkedQueue.java54 * An unbounded thread-safe {@linkplain Queue queue} based on linked nodes.
55 * This queue orders elements FIFO (first-in-first-out).
56 * The <em>head</em> of the queue is that element that has been on the
57 * queue the longest time.
58 * The <em>tail</em> of the queue is that element that has been on the
59 * queue the shortest time. New elements
60 * are inserted at the tail of the queue, and the queue retrieval
61 * operations obtain elements at the head of the queue.
74 * reflecting the state of the queue a
817 final ConcurrentLinkedQueue<E> queue; field in class:ConcurrentLinkedQueue.CLQSpliterator
821 CLQSpliterator(ConcurrentLinkedQueue<E> queue) argument
[all...]
H A DLinkedBlockingDeque.java662 * Retrieves and removes the head of the queue represented by this deque.
668 * @return the head of the queue represented by this deque
688 * Retrieves, but does not remove, the head of the queue represented by
694 * @return the head of the queue represented by this deque
847 // * queue. Attempts to addAll of a queue to itself result in
852 // * @param c collection containing elements to be added to this queue
853 // * @return {@code true} if this queue changed as a result of the call
1132 final LinkedBlockingDeque<E> queue; field in class:LinkedBlockingDeque.LBDSpliterator
1137 LBDSpliterator(LinkedBlockingDeque<E> queue) { argument
[all...]
H A DConcurrentLinkedDeque.java1442 final ConcurrentLinkedDeque<E> queue; field in class:ConcurrentLinkedDeque.CLDSpliterator
1446 CLDSpliterator(ConcurrentLinkedDeque<E> queue) { argument
1447 this.queue = queue;
1452 final ConcurrentLinkedDeque<E> q = this.queue;
1485 final ConcurrentLinkedDeque<E> q = this.queue;
1502 final ConcurrentLinkedDeque<E> q = this.queue;
/libcore/ojluni/src/main/java/sun/util/locale/
H A DLocaleObjectCache.java41 private ReferenceQueue<V> queue = new ReferenceQueue<>(); field in class:LocaleObjectCache
69 CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue);
86 CacheEntry<K, V> entry = new CacheEntry<>(key, value, queue);
94 while ((entry = (CacheEntry<K, V>)queue.poll()) != null) {
108 CacheEntry(K key, V value, ReferenceQueue<V> queue) { argument
109 super(value, queue);
/libcore/ojluni/src/main/java/sun/nio/ch/
H A DEPollPort.java77 // queue of events for cases that a polling thread dequeues more than one
79 private final ArrayBlockingQueue<Event> queue; field in class:EPollPort
106 // create the queue and offer the special event to ensure that the first
108 this.queue = new ArrayBlockingQueue<Event>(MAX_EPOLL_EVENTS);
109 this.queue.offer(NEED_TO_POLL);
197 * corresponding channel in batch and queue n-1 so that
214 // queue special event if there are more events
217 queue.offer(EXECUTE_TASK_OR_SHUTDOWN);
231 queue.offer(ev);
244 queue
[all...]
H A DFileLockTable.java92 ReferenceQueue<FileLock> queue,
94 super(referent, queue);
109 // reference queue for cleared refs
110 private static ReferenceQueue<FileLock> queue = new ReferenceQueue<FileLock>(); field in class:SharedFileLockTable
137 list.add(new FileLockReference(fl, queue, fileKey));
153 list.add(new FileLockReference(fl, queue, fileKey));
161 // process any stale entries pending in the reference queue
240 list.set(index, new FileLockReference(toLock, queue, fileKey));
259 // Process the reference queue
262 while ((ref = (FileLockReference)queue
91 FileLockReference(FileLock referent, ReferenceQueue<FileLock> queue, FileKey key) argument
[all...]
/libcore/ojluni/src/main/java/sun/security/util/
H A DCache.java258 private final ReferenceQueue<V> queue; field in class:MemoryCache
268 this.queue = new ReferenceQueue<>();
270 this.queue = null;
277 * Empty the reference queue and remove all corresponding entries
284 if (queue == null) {
290 CacheEntry<K,V> entry = (CacheEntry<K,V>)queue.poll();
347 if (queue != null) {
353 while (queue.poll() != null) {
364 CacheEntry<K,V> newEntry = newEntry(key, value, expirationTime, queue);
460 long expirationTime, ReferenceQueue<V> queue) {
459 newEntry(K key, V value, long expirationTime, ReferenceQueue<V> queue) argument
522 SoftCacheEntry(K key, V value, long expirationTime, ReferenceQueue<V> queue) argument
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/
H A DReferenceTest.java124 ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
126 r = newWeakReference(queue);
128 Reference ref = queue.remove();
133 r = newWeakReference(queue);
136 // wait for the reference queue thread to enqueue the newly-finalized object
140 ref = queue.poll();
231 private WeakReference<Object> newWeakReference(ReferenceQueue<Object> queue) { argument
233 WeakReference<Object> ref = new WeakReference<Object>(o, queue);
/libcore/luni/src/test/java/libcore/java/lang/ref/
H A DReferenceQueueTest.java129 private void enqueueLater(final ReferenceQueue<Object> queue, int delayMillis) { argument
132 enqueue(queue);
137 private void enqueue(ReferenceQueue<Object> queue) { argument
138 new WeakReference<Object>(new Object(), queue).enqueue();
/libcore/metrictests/memory/host/src/libcore/heapmetrics/
H A DHeapCategorization.java294 Queue<AhatInstance> queue = new ArrayDeque<>();
296 queue.add(rooted);
297 while (!queue.isEmpty()) {
298 AhatInstance instance = queue.remove();
317 queue.add(reference);
/libcore/luni/src/main/java/java/lang/ref/
H A DFinalizerReference.java25 // This queue contains those objects eligible for finalization.
26 public static final ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); field in class:FinalizerReference
28 // Guards the list (not the queue).
56 FinalizerReference<?> reference = new FinalizerReference<Object>(referent, queue);
103 // and then put it on the queue so that it can be finalized.
113 // list. This is required instead of enqueuing directly on the finalizer queue
115 // yet on the finalizer queue. This could cause the sentinel to run before the
/libcore/libart/src/main/java/java/lang/
H A DDaemons.java31 * Calls Object.finalize() on objects in the finalizer reference queue. The VM
163 * pending list to the managed reference queue.
195 private final ReferenceQueue<Object> queue = FinalizerReference.queue; field in class:Daemons.FinalizerDaemon
223 FinalizerReference<?> finalizingReference = (FinalizerReference<?>)queue.poll();
232 finalizingReference = (FinalizerReference<?>)queue.remove();

Completed in 491 milliseconds

12