private ThreadPoolExecutor pool=null;
pool=new ThreadPoolExecutor(DEFAULT_THREAD_COUNT,MAX_THREAD_COUNT,20,TimeUnit.SECONDS, new ArrayBlockingQueue
pool.prestartCoreThread();
// now repeatedly use
WorkerThread thread=new WorkerThread(pdfUri,cs);
pool.execute(thread); // will submit new thread into the que.
// to shutdown
pool.awaitTermination(15,TimeUnit.SECONDS);
pool.shutdown();
No comments:
Post a Comment