question: private void interruptIdleWorkers ( boolean onlyOne ) { final ReentrantLock mainLock = this . mainLock ; mainLock . lock ( ) ; try { Iterator < Worker > it = workers . iterator ( ) ; while ( it . hasNext ( ) ) { Worker w = it . next ( ) ; Thread t = w . thread ; if ( ! t . isInterrupted ( ) && w . tryLock ( ) ) { try { t . interrupt ( ) ; } catch ( SecurityException ignore ) { } finally { w . unlock ( ) ; } } if ( onlyOne ) break ; } } finally { mainLock . unlock ( ) ; } }
target:  Interrupts threads that might be waiting for tasks (as indicated by not being locked) so they can check for termination or configuration changes. Ignores SecurityExceptions (in which case some threads may remain uninterrupted).