Revision 990 org.gvsig.raster.cache/trunk/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.impl/src/main/java/org/gvsig/raster/cache/tile/impl/pool/ThreadTask.java

View differences:

ThreadTask.java
7 7
 * @author Nacho Brodin (nachobrodin@gmail.com)
8 8
 */
9 9
class ThreadTask extends Thread {
10
	private ThreadPool pool = null;
11
	private boolean    stop = false;
10
	private ThreadPoolImpl pool   = null;
11
	private boolean    stop       = false;
12
	private Runnable   currentJob = null;      
12 13

  
13
	public ThreadTask(ThreadPool thePool) {
14
	public ThreadTask(ThreadPoolImpl thePool) {
14 15
		pool = thePool;
15 16
	}
16 17

  
17 18
	public void run() {
18 19
		while (!stop) {
19
			Runnable job = pool.getNext();
20
			job.run();
20
			currentJob = pool.getNext();
21
			currentJob.run();
21 22
		}
22 23
	}
23 24
	
24 25
	/**
25 26
	 * Stops this thread
26 27
	 */
27
	public void stopThread() {
28
	public Runnable stopThread() {
28 29
		stop = true;
30
		return currentJob;
29 31
	}
30 32
}

Also available in: Unified diff