corda/classpath/java/util/concurrent/BlockingDeque.java
Mike Jensen 68fca60d21 Added interface BlockingDeque, and implementation for ExecutorCompletionService and LinkedBlockingQueue.
I had to implement a blocking queue for ExecutorCompletionService.  LinkedBlockingQueue could be very easily extended right now to implement the java 7 LinkedBlockingDeque.  Right now LinkedBlockingQueue just synchronizes and depends on LinkedList implementation.  But I wrote a very complete unit test suite so we if we want to put a more concurrent design here, we have a complete test suite to verify against.# Please enter the commit message for your changes. Lines starting
2014-03-10 19:06:37 -06:00

14 lines
398 B
Java

package java.util.concurrent;
import java.util.Deque;
public interface BlockingDeque<T> extends Deque<T>, BlockingQueue<T> {
public T takeFirst() throws InterruptedException;
public T takeLast() throws InterruptedException;
public T pollFirst(long timeout, TimeUnit unit) throws InterruptedException;
public T pollLast(long timeout, TimeUnit unit) throws InterruptedException;
}