Code example for AtomicInteger

Methods: getAndDecrement

0
        // traversing p to maintain their weak-consistency guarantee. 
        p.item = null;
        trail.next = p.next;
        if (last == p)
            last = trail;
        if (count.getAndDecrement() == capacity)
            notFull.signal();
    } 
 
    /** 
     * Removes a single instance of the specified element from this queue, 
     * if it is present.  More formally, removes an element {@code e} such 
     * that {@code o.equals(e)}, if this queue contains one or more such 
     * elements. 
     * Returns {@code true} if this queue contained the specified element 
     * (or equivalently, if this queue changed as a result of the call). 
     * 
     * @param o element to be removed from this queue, if present 
     * @return {@code true} if this queue changed as a result of the call 
     */ 
Experience pair programming with AI  Get Codota for Java