Home
last modified time | relevance | path

Searched refs:queue (Results 1 – 25 of 40) sorted by relevance

12

/libcore/ojluni/src/main/java/java/util/
DTimer.java101 private final TaskQueue queue = new TaskQueue(); field in Timer
108 private final TimerThread thread = new TimerThread(queue);
119 synchronized(queue) {
121 queue.notify(); // In case queue is empty.
402 synchronized(queue) { in sched()
415 queue.add(task); in sched()
416 if (queue.getMin() == task) in sched()
417 queue.notify(); in sched()
436 synchronized(queue) { in cancel()
438 queue.clear(); in cancel()
[all …]
DPriorityQueue.java97 transient Object[] queue; // non-private to simplify nested class access field in PriorityQueue
168 this.queue = new Object[initialCapacity]; in PriorityQueue()
247 this.queue = c.toArray(); in initFromPriorityQueue()
264 this.queue = a; in initElementsFromCollection()
292 int oldCapacity = queue.length; in grow()
300 queue = Arrays.copyOf(queue, newCapacity); in grow()
338 if (i >= queue.length) in offer()
342 queue[0] = e; in offer()
350 return (size == 0) ? null : (E) queue[0]; in peek()
356 if (o.equals(queue[i])) in indexOf()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DAbstractQueueTest.java31 private MockAbstractQueue<Object> queue; field in AbstractQueueTest
113 queue.add(null); in test_addLE_null()
127 queue.add(o); in test_addLE_Full()
131 queue.add(o); in test_addLE_Full()
145 queue.add(o); in test_addLE()
148 queue.add(I); in test_addLE()
149 assertTrue(queue.contains(I)); in test_addLE()
150 Iterator iter = queue.iterator(); in test_addLE()
162 queue.addAll(null); in test_addAllLE_null()
175 queue.addAll(list); in test_addAllLE_with_null()
[all …]
DPriorityQueueTest.java198 PriorityQueue<Object> queue = new PriorityQueue<Object>(); in test_Constructor() local
199 assertNotNull(queue); in test_Constructor()
200 assertEquals(0, queue.size()); in test_Constructor()
201 assertNull(queue.comparator()); in test_Constructor()
208 PriorityQueue<Object> queue = new PriorityQueue<Object>(100); in test_ConstructorI() local
209 assertNotNull(queue); in test_ConstructorI()
210 assertEquals(0, queue.size()); in test_ConstructorI()
211 assertNull(queue.comparator()); in test_ConstructorI()
218 PriorityQueue<Object> queue = new PriorityQueue<Object>(100, in test_ConstructorILjava_util_Comparator() local
220 assertNotNull(queue); in test_ConstructorILjava_util_Comparator()
[all …]
/libcore/benchmarks/src/benchmarks/
DReferenceBenchmark.java34 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAlloc() local
36 new PhantomReference(object, queue); in timeAlloc()
42 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAllocAndEnqueue() local
44 (new PhantomReference<Object>(object, queue)).enqueue(); in timeAllocAndEnqueue()
50 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAllocEnqueueAndPoll() local
52 (new PhantomReference<Object>(object, queue)).enqueue(); in timeAllocEnqueueAndPoll()
55 queue.poll(); in timeAllocEnqueueAndPoll()
61 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAllocEnqueueAndRemove() local
63 (new PhantomReference<Object>(object, queue)).enqueue(); in timeAllocEnqueueAndRemove()
67 queue.remove(); in timeAllocEnqueueAndRemove()
[all …]
/libcore/ojluni/src/main/java/java/lang/ref/
DReference.java72 final ReferenceQueue<? super T> queue; field in Reference
188 return queue != null && queue.isEnqueued(this); in isEnqueued()
203 return queue != null && queue.enqueue(this); in enqueue()
212 Reference(T referent, ReferenceQueue<? super T> queue) { in Reference() argument
214 this.queue = queue; in Reference()
DReferenceQueue.java222 ReferenceQueue queue = list.queue; in enqueuePending() local
223 if (queue == null) { in enqueuePending()
236 synchronized (queue.lock) { in enqueuePending()
245 queue.enqueueLocked(list); in enqueuePending()
247 } while (list != start && list.queue == queue); in enqueuePending()
248 queue.lock.notifyAll(); in enqueuePending()
/libcore/luni/src/test/java/libcore/java/util/
DOldPriorityQueueTest.java28 PriorityQueue<Object> queue = new PriorityQueue<Object>(100); in test_ConstructorI() local
29 assertNotNull(queue); in test_ConstructorI()
30 assertEquals(0, queue.size()); in test_ConstructorI()
31 assertNull(queue.comparator()); in test_ConstructorI()
42 PriorityQueue<String> queue = new PriorityQueue<String>(10, in test_remove_Ljava_lang_Object_using_comparator() local
46 queue.offer(array[i]); in test_remove_Ljava_lang_Object_using_comparator()
48 assertFalse(queue.contains("BB")); in test_remove_Ljava_lang_Object_using_comparator()
51 assertFalse(queue.remove("BB")); in test_remove_Ljava_lang_Object_using_comparator()
52 assertTrue(queue.remove("AA")); in test_remove_Ljava_lang_Object_using_comparator()
DCollectionsTest.java405 Queue queue = checkedQueue(new LinkedBlockingDeque<>(2), CharSequence.class); in test_checkedQueue() local
406 assertQueueEmpty(queue); in test_checkedQueue()
410 assertTrue(queue.add(firstElement)); in test_checkedQueue()
411 assertFalse(queue.isEmpty()); in test_checkedQueue()
412 assertTrue(queue.add("second element")); in test_checkedQueue()
413 assertEquals(2, queue.size()); in test_checkedQueue()
415 assertFalse(queue.offer("third element")); // queue is at capacity in test_checkedQueue()
417 queue.add("third element"); in test_checkedQueue()
421 assertThrowsCce(() -> { queue.add(new Object()); }); // fails the type check in test_checkedQueue()
422 assertEquals(2, queue.size()); // size is unchanged in test_checkedQueue()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DScheduledThreadPoolExecutor.java876 private RunnableScheduledFuture<?>[] queue = field in ScheduledThreadPoolExecutor.DelayedWorkQueue
920 RunnableScheduledFuture<?> e = queue[parent]; in siftUp()
923 queue[k] = e; in siftUp()
927 queue[k] = key; in siftUp()
939 RunnableScheduledFuture<?> c = queue[child]; in siftDown()
941 if (right < size && c.compareTo(queue[right]) > 0) in siftDown()
942 c = queue[child = right]; in siftDown()
945 queue[k] = c; in siftDown()
949 queue[k] = key; in siftDown()
957 int oldCapacity = queue.length; in grow()
[all …]
DPriorityBlockingQueue.java150 private transient Object[] queue; field in PriorityBlockingQueue
226 this.queue = new Object[initialCapacity]; in PriorityBlockingQueue()
273 this.queue = a; in PriorityBlockingQueue()
303 if (newCap > oldCap && queue == array) in tryGrow()
312 if (newArray != null && queue == array) { in tryGrow()
313 queue = newArray; in tryGrow()
326 Object[] array = queue; in dequeue()
437 Object[] array = queue; in heapify()
483 while ((n = size) >= (cap = (array = queue).length)) in offer()
573 return (size == 0) ? null : (E) queue[0]; in peek()
[all …]
DLinkedBlockingQueue.java831 final LinkedBlockingQueue<E> queue; field in LinkedBlockingQueue.LBQSpliterator
836 LBQSpliterator(LinkedBlockingQueue<E> queue) { in LBQSpliterator() argument
837 this.queue = queue; in LBQSpliterator()
838 this.est = queue.size(); in LBQSpliterator()
845 final LinkedBlockingQueue<E> q = this.queue; in trySplit()
884 final LinkedBlockingQueue<E> q = this.queue; in forEachRemaining()
911 final LinkedBlockingQueue<E> q = this.queue; in tryAdvance()
/libcore/ojluni/src/main/java/sun/util/locale/
DLocaleObjectCache.java41 private ReferenceQueue<V> queue = new ReferenceQueue<>(); field in LocaleObjectCache
69 CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue); in get()
86 CacheEntry<K, V> entry = new CacheEntry<>(key, value, queue); in put()
94 while ((entry = (CacheEntry<K, V>)queue.poll()) != null) { in cleanStaleEntries()
108 CacheEntry(K key, V value, ReferenceQueue<V> queue) { in CacheEntry() argument
109 super(value, queue); in CacheEntry()
/libcore/ojluni/src/main/java/sun/security/util/
DCache.java258 private final ReferenceQueue<V> queue; field in MemoryCache
268 this.queue = new ReferenceQueue<>(); in MemoryCache()
270 this.queue = null; in MemoryCache()
284 if (queue == null) { in emptyQueue()
290 CacheEntry<K,V> entry = (CacheEntry<K,V>)queue.poll(); in emptyQueue()
347 if (queue != null) { in clear()
353 while (queue.poll() != null) { in clear()
364 CacheEntry<K,V> newEntry = newEntry(key, value, expirationTime, queue); in put()
460 long expirationTime, ReferenceQueue<V> queue) { in newEntry() argument
461 if (queue != null) { in newEntry()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DEPollPort.java79 private final ArrayBlockingQueue<Event> queue; field in EPollPort
108 this.queue = new ArrayBlockingQueue<Event>(MAX_EPOLL_EVENTS); in EPollPort()
109 this.queue.offer(NEED_TO_POLL); in EPollPort()
217 queue.offer(EXECUTE_TASK_OR_SHUTDOWN); in poll()
231 queue.offer(ev); in poll()
244 queue.offer(NEED_TO_POLL); in poll()
262 ev = queue.take(); in run()
DFileLockTable.java92 ReferenceQueue<FileLock> queue, in FileLockReference() argument
94 super(referent, queue); in FileLockReference()
110 private static ReferenceQueue<FileLock> queue = new ReferenceQueue<FileLock>(); field in SharedFileLockTable
137 list.add(new FileLockReference(fl, queue, fileKey)); in add()
153 list.add(new FileLockReference(fl, queue, fileKey)); in add()
240 list.set(index, new FileLockReference(toLock, queue, fileKey)); in replace()
262 while ((ref = (FileLockReference)queue.poll()) != null) { in removeStaleEntries()
/libcore/ojluni/annotations/hiddenapi/java/lang/ref/
DReference.java38 Reference(T referent, java.lang.ref.ReferenceQueue<? super T> queue) { in Reference() argument
71 final java.lang.ref.ReferenceQueue<? super T> queue; field in Reference
74 queue = null;
/libcore/ojluni/annotations/hiddenapi/sun/security/util/
DMemoryCache.java77 K key, V value, long expirationTime, java.lang.ref.ReferenceQueue<V> queue) { in newEntry() argument
95 private final java.lang.ref.ReferenceQueue<V> queue; field in MemoryCache
98 queue = null;
150 SoftCacheEntry(K key, V value, long expirationTime, java.lang.ref.ReferenceQueue<V> queue) { in SoftCacheEntry() argument
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/
DReferenceTest.java181 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in test_get_WeakReference() local
183 r = newWeakReference(queue); in test_get_WeakReference()
185 Reference ref = queue.remove(); in test_get_WeakReference()
190 r = newWeakReference(queue); in test_get_WeakReference()
197 ref = queue.poll(); in test_get_WeakReference()
288 private WeakReference<Object> newWeakReference(ReferenceQueue<Object> queue) { in newWeakReference() argument
290 WeakReference<Object> ref = new WeakReference<Object>(o, queue); in newWeakReference()
/libcore/luni/src/test/java/libcore/java/lang/ref/
DReferenceQueueTest.java151 private void enqueueLater(final ReferenceQueue<Object> queue, long delayMillis) { in enqueueLater() argument
154 enqueue(queue); in enqueueLater()
159 private void enqueue(ReferenceQueue<Object> queue) { in enqueue() argument
160 new WeakReference<Object>(new Object(), queue).enqueue(); in enqueue()
/libcore/metrictests/memory/host/src/libcore/heapmetrics/
DHeapCategorization.java294 Queue<AhatInstance> queue = new ArrayDeque<>(); in isOwnedByClassMatching() local
296 queue.add(rooted); in isOwnedByClassMatching()
297 while (!queue.isEmpty()) { in isOwnedByClassMatching()
298 AhatInstance instance = queue.remove(); in isOwnedByClassMatching()
317 queue.add(reference); in isOwnedByClassMatching()
/libcore/ojluni/annotations/hiddenapi/java/util/concurrent/
DPriorityBlockingQueue.java233 private transient java.lang.Object[] queue; field in PriorityBlockingQueue
273 java.util.concurrent.PriorityBlockingQueue<E> queue, in PBQSpliterator() argument
310 final java.util.concurrent.PriorityBlockingQueue<E> queue; field in PriorityBlockingQueue.PBQSpliterator
313 queue = null;
DLinkedBlockingQueue.java248 LBQSpliterator(java.util.concurrent.LinkedBlockingQueue<E> queue) { in LBQSpliterator() argument
282 final java.util.concurrent.LinkedBlockingQueue<E> queue; field in LinkedBlockingQueue.LBQSpliterator
285 queue = null;
/libcore/libart/src/main/java/java/lang/
DDaemons.java235 private final ReferenceQueue<Object> queue = FinalizerReference.queue; field in Daemons.FinalizerDaemon
264 FinalizerReference<?> finalizingReference = (FinalizerReference<?>)queue.poll(); in runInternal()
273 finalizingReference = (FinalizerReference<?>)queue.remove(); in runInternal()
/libcore/luni/src/main/java/java/lang/ref/
DFinalizerReference.java28 public static final ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); field in FinalizerReference
61 FinalizerReference<?> reference = new FinalizerReference<Object>(referent, queue); in add()

12