T
- element type@Internal
public final class MpscQueue<T>
extends java.lang.Object
This queue supports two operations:
add(Object)
atomically adds an element to this queue and returns the number of
elements in the queue after the addition.
drainAll()
atomically obtains a snapshot of the queue and simultaneously empties
the queue, i.e. drains it.
Constructor and Description |
---|
MpscQueue(int initialBufferSize,
Lock lock) |
Modifier and Type | Method and Description |
---|---|
int |
add(T element)
Adds an element to this (unbound) queue.
|
java.util.Deque<T> |
drainAll()
Atomically drains the queue.
|
public MpscQueue(int initialBufferSize, Lock lock)
public int add(T element)
element
- the element to add.public java.util.Deque<T> drainAll()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.