Code example for ReentrantLock

Methods: newCondition

    /** Maximum number of items in the deque */ 
    private final int capacity;
    /** Main lock guarding all access */ 
    final ReentrantLock lock = new ReentrantLock();
    /** Condition for waiting takes */ 
    private final Condition notEmpty = lock.newCondition();
    /** Condition for waiting puts */ 
    private final Condition notFull = lock.newCondition();
     * Creates a {@code LinkedBlockingDeque} with a capacity of 
     * {@link Integer#MAX_VALUE}. 
    public LinkedBlockingDeque() { 
Stop searching for code, let great code find you!  Add Codota to your java IDE