Code example for AbstractExecutorService

Methods: shutdown

0
	/** 
	 * 关闭,并等待任务执行完成,不接受新任务 
	 */ 
	public static  void shutdown(){ 
		if(pool!=null){
			pool.shutdown();
			LogUtil.i(DefaultThreadPool.class.getName(), "DefaultThreadPool shutdown");
		} 
	} 
	 
	/** 
	 * 关闭,立即关闭,并挂起所有正在执行的线程,不接受新任务 
	 */ 
	public  static void shutdownRightnow(){ 
		if(pool!=null){
			//List<Runnable>  tasks =pool.shutdownNow(); 
			pool.shutdownNow();
			try { 
				//设置超时极短,强制关闭所有任务 
				pool.awaitTermination(1, TimeUnit.MICROSECONDS);
			} catch (InterruptedException e) {