ThreadPoolExecutor excutor = new ThreadPoolExecutor(6, 8, 60L, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(100), new ThreadPoolExecutor.CallerRunsPolicy());
excutor.prestartAllCoreThreads();
GitTask task=new GitTask(taskMap);
excutor.execute(task);
class GitTask implements Runnable{
private Map<String,List<String>> taskMap;
public GitTask(Map<String,List<String>> taskMap ) {
this.taskMap=taskMap;
}
public void run() {
//do your work
}
}