Back to project page androidcodes.
The source code is released under:
GNU General Public License
If you think the Android project androidcodes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.pract.threadpool; /* w ww . j av a 2 s .c om*/ public class Worker implements Runnable{ private MyQueue<Runnable> myQueue; private String name; public Worker(MyQueue<Runnable> myQueue, String name){ this.myQueue = myQueue; this.name = name; } @Override public void run() { while(true){ Runnable r = myQueue.dequeue(); // print the dequeued item System.out.println(" Taken Item by thread name:" + this.name ); // run it r.run(); System.out.println(" Task completed of thread:" + this.name); } } }