public static < E > void setMax ( E obj , AtomicLongFieldUpdater < E > updater , long value ) { for ( ; ; ) { long current = updater . get ( obj ) ; if ( current >= value ) { return ; } if ( updater . compareAndSet ( obj , current , value ) ) { return ; } } }
Atomically sets the max value .