Say I have this:
class Queue {
private static ExecutorService executor = Executors.newFixedThreadPool(1);
public void use(Runnable r){
Queue.executor.execute(r);
}
}
my question is - how can I define the thread that's used in the pool, specifically would like to override the interrupt method on thread(s) in the pool:
@Override
public void interrupt() {
synchronized(x){
isInterrupted = true;
super.interrupt();
}
}