Code example for Condition

Methods: signal

0
            this.queue.offer(e);
            Collections.sort(this.queue);
            // Leader is changed. 
            if (this.queue.peek() == e) {
                this.leader = null;
                this.available.signal();
            } 
        } 
        finally { 
            lock.unlock();
        } 
    } 
 
 
    public int size() { 
        final Lock lock = this.lock;
        lock.lock();
        try { 
            return this.queue.size();
        } 
Experience pair programming with AI  Get Codota for Java