public int getIdleThreads ( ) { if ( executor instanceof ThreadPoolExecutor ) { final ThreadPoolExecutor tpe = ( ThreadPoolExecutor ) executor ; return tpe . getPoolSize ( ) - tpe . getActiveCount ( ) ; } return - 1 ; }
Get the number of idle threads