/** * Add the given value to current counter value. Concurrent updates will * not be lost, but addAndGet or getAndAdd are not implemented because the * total counter value (i.e., {@link #get}) is not atomically updated. * Updates are striped across an array of counters to avoid cache contention * and has been tested with performance scaling linearly up to 768 CPUs. */ public void add( long x ) { add_if( x); } /** {@link #add} with -1 */
/** {@link #add} with +1 */ public void increment() { add_if( 1L); }
/** {@link #add} with -1 */ public void decrement() { add_if(-1L); } /** {@link #add} with +1 */
/** * Add the given value to current counter value. Concurrent updates will * not be lost, but addAndGet or getAndAdd are not implemented because the * total counter value (i.e., {@link #get}) is not atomically updated. * Updates are striped across an array of counters to avoid cache contention * and has been tested with performance scaling linearly up to 768 CPUs. */ public void add( long x ) { add_if( x); } /** {@link #add} with -1 */
/** {@link #add} with -1 */ public void decrement() { add_if(-1L); } /** {@link #add} with +1 */
/** {@link #add} with +1 */ public void increment() { add_if( 1L); }