publicclassThreadPoolConfig{privatestaticExecutorService thredPool;privatestaticboolean flag =false;privateThreadPoolConfig(){}publicstaticExecutorServicegetInstance(){if(flag){if(thredPool !=null){return thredPool;}else{synchronized(ExecutorService.class){if(thredPool ==null){Executors.newFixedThreadPool(8);
flag =true;}}}}return thredPool;}}