final void signalWork ( ) { long c ; int u ; while ( ( u = ( int ) ( ( c = ctl ) >>> 32 ) ) < 0 ) { // too few active WorkQueue [ ] ws = workQueues ; int e , i ; WorkQueue w ; Thread p ; if ( ( e = ( int ) c ) > 0 ) { // at least one waiting if ( ws != null && ( i = e & SMASK ) < ws . length && ( w = ws [ i ] ) != null && w . eventCount == ( e | INT_SIGN ) ) { long nc = ( ( ( long ) ( w . nextWait & E_MASK ) ) | ( ( long ) ( u + UAC_UNIT ) << 32 ) ) ; if ( U . compareAndSwapLong ( this , CTL , c , nc ) ) { w . eventCount = ( e + E_SEQ ) & E_MASK ; if ( ( p = w . parker ) != null ) U . unpark ( p ) ; // activate and release break ; } } else break ; } else if ( e == 0 && ( u & SHORT_SIGN ) != 0 ) { // too few total long nc = ( long ) ( ( ( u + UTC_UNIT ) & UTC_MASK ) | ( ( u + UAC_UNIT ) & UAC_MASK ) ) << 32 ; if ( U . compareAndSwapLong ( this , CTL , c , nc ) ) { addWorker ( ) ; break ; } } else break ; } }
Tries to activate or create a worker if too few are active .