Code example for Condition

Methods: signalAll

0
    @Override 
    public void add(T item) {
        super.add(item);
        try { 
            lock.lock();
            condition.signalAll();
        } finally { 
            lock.unlock();
        } 
    } 
 
    @Override 
    public T take(AtomicLong idx) {
        T result;
        while ((result = super.take(idx)) == null)
            try { 
                lock.lock();
                condition.await();
            } catch (InterruptedException e) {
                // ignored 
            } finally {