private void tryAddWorker ( long c ) { do { long nc = ( ( AC_MASK & ( c + AC_UNIT ) ) | ( TC_MASK & ( c + TC_UNIT ) ) ) ; if ( ctl == c && U . compareAndSwapLong ( this , CTL , c , nc ) ) { createWorker ( false ) ; break ; } } while ( ( ( c = ctl ) & ADD_WORKER ) != 0L && ( int ) c == 0 ) ; }
Tries to add one worker incrementing ctl counts before doing so relying on createWorker to back out on failure .