public int addAndGetLo ( int delta ) { while ( true ) { long encoded = get ( ) ; int lo = getLo ( encoded ) + delta ; long update = encodeLo ( encoded , lo ) ; if ( compareAndSet ( encoded , update ) ) return lo ; } }
Atomically adds the given delta to the current lo value returning the updated lo value .