Example usage for Java java.util.concurrent SynchronousQueue fields, constructors, methods, implement or subclass
The text is from its open source code.
SynchronousQueue() Creates a SynchronousQueue with nonfair access policy. | |
SynchronousQueue(boolean fair) Creates a SynchronousQueue with the specified fairness policy. |
boolean | add(E e) Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available. |
E | poll(long timeout, TimeUnit unit) Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it. |
void | put(E e) Adds the specified element to this queue, waiting if necessary for another thread to receive it. |
E | take() Retrieves and removes the head of this queue, waiting if necessary for another thread to insert it. |