自己实现的java thread pool
摘要:
Worker.javapackagepool;publicclassWorkerextendsThread{privateThreadPoolthreadPool;privateRunnabletask;publicWorker(ThreadPoolthreadPool){this.threadPool=threadPool;}publicsynchronizedvoidpush(Runnabletask){this.task=task;this.notify();}publicsynchronizedvoidrun(){while(true){try{this.wait();}catch(I 阅读全文
posted @ 2012-08-25 16:18 bcac 阅读(414) 评论(0) 推荐(0)