final void signalWork ( ) { for ( ; ; ) { long c ; int sp , i ; WorkQueue v ; WorkQueue [ ] ws ; if ( ( c = ctl ) >= 0L ) // enough workers break ; else if ( ( sp = ( int ) c ) == 0 ) { // no idle workers if ( ( c & ADD_WORKER ) != 0L ) // too few workers tryAddWorker ( c ) ; break ; } else if ( ( ws = workQueues ) == null ) break ; // unstarted/terminated else if ( ws . length <= ( i = sp & SMASK ) ) break ; // terminated else if ( ( v = ws [ i ] ) == null ) break ; // terminating else { int ns = sp & ~ UNSIGNALLED ; int vs = v . scanState ; long nc = ( v . stackPred & SP_MASK ) | ( UC_MASK & ( c + AC_UNIT ) ) ; if ( sp == vs && U . compareAndSwapLong ( this , CTL , c , nc ) ) { v . scanState = ns ; LockSupport . unpark ( v . parker ) ; break ; } } } }
Tries to create or activate a worker if too few are active .