1 31 package org.objectweb.proactive.core.group.threadpool; 32 33 34 35 public class ThreadInThePool extends Thread { 36 protected static int counter; 37 38 protected synchronized static int getNextValue() { 39 return counter++; 40 } 41 42 43 public ThreadPool myPool; 44 45 48 public ThreadInThePool(ThreadPool o) { 49 this.myPool = o; 50 this.setName("ThreadInThePool " + ThreadInThePool.getNextValue()); 51 } 52 53 54 public void run() { 55 Runnable target = null; 56 do { 57 target = this.myPool.getJobForThePendingQueue(); 58 if (target != null) { 59 target.run(); 60 this.myPool.controler.jobFinish(); 61 } 62 } while (target != null); 63 } 64 } 65 | Popular Tags |