/libcore/ojluni/src/main/java/java/lang/ref/ |
H A D | Reference.java | 60 final ReferenceQueue<? super T> queue; field in class:Reference 66 * before it has been removed from its queue, the queueNext field points 67 * to the next reference on the queue. The last reference on a queue 69 * reference queue, the queueNext field points to the 74 * internal to 'queue'. 125 * not registered with a queue when it was created, then this method will 133 // after this reference object has been removed from its queue 136 return queue != null && queue 161 Reference(T referent, ReferenceQueue<? super T> queue) argument [all...] |
/libcore/luni/src/test/java/libcore/java/lang/ref/ |
H A D | ReferenceQueueTest.java | 129 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/ojluni/src/main/java/sun/util/locale/ |
H A D | LocaleObjectCache.java | 41 private ReferenceQueue<V> queue = new ReferenceQueue<>(); field in class:LocaleObjectCache 67 CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue); 84 CacheEntry<K, V> entry = new CacheEntry<>(key, value, queue); 92 while ((entry = (CacheEntry<K, V>)queue.poll()) != null) { 106 CacheEntry(K key, V value, ReferenceQueue<V> queue) { argument 107 super(value, queue);
|
/libcore/luni/src/main/java/java/lang/ref/ |
H A D | FinalizerReference.java | 25 // 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/ |
H A D | ReferenceTest.java | 124 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
H A D | AbstractQueueTest.java | 31 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...] |
/libcore/ojluni/src/main/java/java/util/ |
H A D | Timer.java | 78 * it uses a binary heap to represent its task queue, so the cost to schedule 91 * The timer task queue. This data structure is shared with the timer 94 * and removing them from the queue when they're obsolete. 96 private final TaskQueue queue = new TaskQueue(); field in class:Timer 101 private final TimerThread thread = new TimerThread(queue); 106 * tasks in the timer queue. It is used in preference to a finalizer on 112 synchronized(queue) { 114 queue.notify(); // In case queue is empty. 395 synchronized(queue) { 497 private TaskQueue queue; field in class:TimerThread 499 TimerThread(TaskQueue queue) argument 578 private TimerTask[] queue = new TimerTask[128]; field in class:TaskQueue [all...] |
H A D | PriorityQueue.java | 31 * 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 D | WeakHashMap.java | 178 * 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...] |
H A D | Collections.java | 3181 * Returns a dynamically typesafe view of the specified queue. 3183 * an immediate {@link ClassCastException}. Assuming a queue contains 3185 * view is generated, and that all subsequent access to the queue 3187 * queue cannot contain an incorrectly typed element. 3193 * <p>The returned queue will be serializable if the specified queue 3197 * type, the returned queue permits insertion of {@code null} elements 3198 * whenever the backing queue does. 3200 * @param <E> the class of the objects in the queue 3201 * @param queue th 3207 checkedQueue(Queue<E> queue, Class<E> type) argument 3219 final Queue<E> queue; field in class:Collections.CheckedQueue 3221 CheckedQueue(Queue<E> queue, Class<E> elementType) argument [all...] |
/libcore/ojluni/src/main/java/sun/nio/ch/ |
H A D | EPollPort.java | 77 // 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 D | FileLockTable.java | 92 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/libart/src/main/java/java/lang/ |
H A D | Daemons.java | 31 * 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();
|
/libcore/ojluni/src/main/java/sun/security/util/ |
H A D | Cache.java | 258 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/ojluni/src/main/java/java/util/concurrent/ |
H A D | ConcurrentLinkedQueue.java | 54 * 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 D | LinkedBlockingQueue.java | 54 * 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 D | PriorityBlockingQueue.java | 57 * 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 D | ConcurrentLinkedDeque.java | 1442 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;
|
H A D | LinkedBlockingDeque.java | 662 * 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 D | ScheduledThreadPoolExecutor.java | 71 * 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...] |
/libcore/ojluni/src/main/java/java/lang/invoke/ |
H A D | MethodType.java | 1223 public WeakEntry(T key, ReferenceQueue<T> queue) { argument 1224 super(key, queue);
|
/libcore/ojluni/src/main/java/java/io/ |
H A D | ObjectStreamClass.java | 93 /** queue for WeakReferences to local classes */ 96 /** queue for WeakReferences to field reflectors keys */ 2180 ReferenceQueue<Class<?>> queue) 2182 super(cl, queue); 2311 * on the specified reference queue. 2313 static void processQueue(ReferenceQueue<Class<?>> queue, argument 2318 while((ref = queue.poll()) != null) { 2336 * with a queue. 2179 FieldReflectorKey(Class<?> cl, ObjectStreamField[] fields, ReferenceQueue<Class<?>> queue) argument
|
/libcore/ojluni/src/main/java/java/lang/ |
H A D | Thread.java | 1604 /** queue for WeakReferences to audited subclasses */ 1958 * on the specified reference queue. 1960 static void processQueue(ReferenceQueue<Class<?>> queue, argument 1965 while((ref = queue.poll()) != null) { 1982 * with a queue.
|
/libcore/luni/src/test/java/libcore/java/util/ |
H A D | CollectionsTest.java | 431 Queue queue = checkedQueue(new LinkedBlockingDeque<>(2), CharSequence.class); 432 assertQueueEmpty(queue); 436 assertTrue(queue.add(firstElement)); 437 assertFalse(queue.isEmpty()); 438 assertTrue(queue.add("second element")); 439 assertEquals(2, queue.size()); 441 assertFalse(queue.offer("third element")); // queue is at capacity 443 queue.add("third element"); 447 assertThrowsCce(() -> { queue 464 assertQueueEmpty(Queue queue) argument [all...] |