private int getAndUpdateTail ( ) { int retMe ; do { retMe = tailIndex . get ( ) ; } while ( tailIndex . compareAndSet ( retMe , getNext ( retMe ) ) == false ) ; return retMe ; }
Atomically update and return the tailIndex .