BlockingQueue
java.util.concurrent public interface BlockingQueue<E> extends Queue<E>
A Queue that additionally supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.
BlockingQueue methods come in four forms, with different ways of handling operations that cannot be satisfied immediately, but may be satisfied at some point in the future:
one throws an exception,
the second returns a special value (either null or false, depending on the operation),
the third blocks the current t
更多推荐
Java 阻塞队列 BlockingQueue 详解: put,add 和 offer 三个方法
发布评论